string
Question:
WAP to input string through command line and check each command line inputs and display only those strings which are in uppercase until any lower case string found.
💡 Solutions (1)
Super Admin
AdminFeb 09, 2026 at 07:39
upvotes
class CheckUpper { public static void main(String[] args) { for (int i = 0; i < args.length; i++) { String s = args[i]; // Check if string is uppercase if (s.equals(s.toUpperCase())) { System.out.println(s); } else { // Stop when lowercase string found break; } } } }
Want to add your solution? Login to contribute!
💬 Comments (0)
Login to post comments
No comments yet
Be the first to comment!