Home »
MCQs »
Java MCQs
What will be the output of following Java code (1)?
16. What will be the output of following Java code?
public class Main {
public static void main(String[] args) {
String str = "Hello";
str = "Bye";
System.out.println(str);
}
}
- Hello
- Bye
- Error
- All of these
Answer: B) Bye