Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. if I put Myresult = name.substring(0, 4); the answer is i lo (which is correct)
  2. but if I put Myresult = name.substring(2,2); the answer is nothing (which is wrong)
  3.  
  4. public class Methods {
  5. public static void main(String[] args) {
  6. String name = "i love you";
  7. String Myresult = name.substring(2,2);
  8. System.out.println(Myresult);
  9. }
  10.  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement