Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if I put Myresult = name.substring(0, 4); the answer is i lo (which is correct)
- but if I put Myresult = name.substring(2,2); the answer is nothing (which is wrong)
- public class Methods {
- public static void main(String[] args) {
- String name = "i love you";
- String Myresult = name.substring(2,2);
- System.out.println(Myresult);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement