Computer Applications
Predict the output of the following Java program snippet:
String str = "Computer Applications" + 1 + 0;
System.out.println("Understanding" + str);
Java
Java String Handling
88 Likes
Answer
UnderstandingComputer Applications10
Working
In the first line, + operator concatenates 1 and 0 to the end of "Computer Applications" so str becomes "Computer Applications10". Next line prints "UnderstandingComputer Applications10" to the console.
Answered By
44 Likes
Related Questions
Write down the syntax to replace the word "old" with the word "new" in a given String st = "old is always old"
Write down the syntax to check if the second character of a String(str) is in upper case.
Predict the output of the following Java program snippet:
String n1 = "46", n2 = "64"; int total = Integer.parseInt(n1) + Integer.parseInt(n2); System.out.println("The sum of " + "46 " + "and" + " 64" + " is " + total);Predict the output of the following Java program snippet:
boolean p; p = ("BLUEJ".length() > "bluej".length()) ? true: false;