Given:
StringBuffer b = new StringBuffer(“3”);
System.out.print(5+4+b+2+1);
What is the result?
A.
54321
B.
9321
C.
5433
D.
933
E.
Output is Similar to: 9java.lang.StringBuffer@100490121.
F.
Compilation fails.
Explanation:
The code will not compile.
The print function cannot handle the mixture of integers and strings.Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – Erroneous tree type
F
F
The operator + is undefined for the argument type(s) int, StringBuffer
Yep F, StringBuffer is a bad operand type for + operator.