What will be displayed as a result of the following code compilation and execution?

String x = "Java";
x.concat(" Rules!");
System.out.println("x = " + x);  
x.toUpperCase();
System.out.println("x = " + x);  
x.replace('a', 'X');
System.out.println("x = " + x);  

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes