Advertisement
476179

act2 -loops1

Nov 14th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package act;
  2. import java.util.Scanner;
  3. public class act2Whileloop
  4. {
  5.  
  6. public static void main(String[] args)
  7. {
  8. Scanner keyboard = new Scanner(System.in);
  9. System.out.println("enter ur name:");
  10. String name = keyboard.nextLine();
  11. name = name.toLowerCase();
  12. int last = name.length();
  13.  
  14. char firstL = name.charAt(0);
  15. char lastL = name.charAt(last);
  16.  
  17.  
  18. String f = Character.toString(firstL);
  19. String l = Character.toString(lastL);
  20. if (name != "done")
  21. while (f.equals(l))
  22. {
  23.  
  24. }
  25.  
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement