Created
September 29, 2022 17:16
-
-
Save fida10/6fe23925a621b7fcd66ab0e969917ceb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class scratch { | |
public static void main(String[] args) { | |
System.out.println(new scratch().defangIPaddr("1.1.1.1")); | |
System.out.println(new scratch().sum(5, 6)); | |
System.out.println(new scratch().size("Hello")); | |
} | |
public String defangIPaddr(String address) { | |
String answer = address.replace(".", "[.]"); | |
return answer; | |
} | |
public int sum(int a, int b){ | |
int c = a + b; | |
return c; | |
} | |
public boolean size(String someString){ | |
if(someString.length() > 5){ | |
return true; | |
} else { | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment