Which is a valid declarations of a String?

Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.

Which is a valid declarations of a String? Answer: String s1 = null;

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).

Question context

This question is part of ☕ Java Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.