Advertisement
rofelbca

java

Mar 14th, 2024
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class string {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. System.out.println("Enter a string:");
  7. String input = scanner.nextLine();
  8. scanner.close();
  9.  
  10. for (int i = 0; i < input.length(); i++) {
  11. char c = Character.toUpperCase(input.charAt(i));
  12. System.out.println(c);
  13. try {
  14. Thread.sleep(1000); // Delay of one second
  15. } catch (Exception e) {
  16. e.printStackTrace();
  17. }
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement