JAVA Programming :: Basic Concepts - Discussion
Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion
30 / 64
Choose the correct option.
String s = new String("xyz");
Assuming the above declaration, which of the following statements would compilation. Select the one correct answer.
As = 2 * s;
Binti = s[0];
Cs = s + s;
Ds = s >> 2;
ENone of the above
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
Option C is correct, because 's' is String type object. s=s+s, means s="xyz"+"xyz", so s="xyzxyz". Rest all other are not possible, hence it won't compile.
Read Full Answer
Report Error
Please Login First Click Here