📚 Practice Mode
Java Constructors and General Programming Quiz
Learn at your own pace with hints and detailed explanations
1 / 20
Multiple Choice
What is the result of compiling and running the following code? String s=new String("hello"); StringBuffer sb=new StringBuffer("hello"); System.out.println(s.equals(sb));
- Compiler error: String and StringBuffer objects cannot be compared
- ClassCastException: String and StringBuffer objects cannot be compared
- Prints "true"
- Prints "false"