Q. The output of the following fraction of code is
public class Test{
public static void main(String args[]){
String s1 = new String("Hello");
String s2 = new String("Hellow");
System.out.println(s1 = s2);
}
}

  • (A) Hello
  • (B) Hellow
  • (C) Compilation error
  • (D) Compilation error D. Throws an exception
πŸ’¬ Discuss
βœ… Correct Answer: (B) Hellow
Explanation: The output of the given code will be:
Explanation by: Rakesh Kumar
The output of the given code will be:

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
121
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Rakesh Kumar
Publisher
πŸ“ˆ
84%
Success Rate