Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class test{
- public static void main(String[] args){
- System.out.println(notString("not bad"));
- }
- public static String notString(String str) {
- if(str.length() < 3){
- return "not " + str;
- }
- String first3 = str.substring(0,3);
- System.out.println(first3);
- System.out.println(first3.length());
- System.out.println(first3 == "not");
- if(first3 == "not"){
- return str;
- }
- else {
- return "not " + str;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement