Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
Java Programming
»
Java.lang Class
What will be the output of the program? String d = "bookkeeper"; d.substring(1,7); d = "w" + d; d.append("woo"); /* Line 4 */ System.out.println(d);
wookkeewoo
wbookkeeper
wbookkeewoo
Compilation fails.
Show Answer
Correct Answer:
Compilation fails.
Explanation:
In line 4 the code calls a
StringBuffer
method,
append()
on a
String
object.
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment