Q. What will be the output of following Java code?

Code:
public class Main {
  public static void main(String[] args) {
    String str = "Hello";
    str = "Bye";
    System.out.println(str);
  }
}
  • (A) Hello
  • (B) Bye
  • (C) Error
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (B) Bye

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
254
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
84%
Success Rate