Java Programming - Language Fundamentals - Discussion
Discussion Forum : Language Fundamentals - General Questions (Q.No. 13)
13.
Which is a valid declarations of a String?
Answer: Option
Explanation:
Option A sets the String reference to null.
Option B is wrong because null cannot be in single quotes.
Option C is wrong because there are multiple characters between the single quotes ('abc').
Option D is wrong because you can't cast a char (primitive) to a String (object).
Discussion:
11 comments Page 2 of 2.
Moin said:
9 years ago
@Swati Jain, the answer is perfectly valid.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers