Single Choice
Not Set
QWhich is a valid declarations of a String?
ID: #1992
Java Language Fundamental
16,434 views
Question Info
#1992Q ID
Not SetDifficulty
Java Language FundamentalTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
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).
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic