string

Java Easy
✅ Solved
Asked by Neelkumar Gohil Feb 03, 2026 at 05:11 Subject: Java Programming

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.

💬 0 Comments 💡 1 Solution(s)

💡 Solutions (1)

✅ ACCEPTED SOLUTION

Super Admin

Admin

Feb 09, 2026 at 07:39

👍 0

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; } } } }

👍 Login to Vote

Want to add your solution? Login to contribute!

💬 Comments (0)

Login to post comments

No comments yet

Be the first to comment!