KnowledgeBoat Logo

Computer Applications

What will be the output for the following program segment?

String s = new String ("abc");
System.out.println(s.toUpperCase( ));

Java

Java String Handling

6 Likes

Answer

ABC

Working

String s stores "abc".

toUpperCase( ) method converts all of the characters in the String to upper case. Thus, "abc" is converted to "ABC" and printed on the output screen.

Answered By

3 Likes


Related Questions