Computer Science, asked by Akhtara5135, 1 year ago

Which is a valid declaration of a string? select one: string s2 = 'null'; string s1 = null; string s4 = (string) '\ufeed'; string s3 = (string) 'abc';?

Answers

Answered by khushi564
5
It is difficult i don't know what is the amswer of this question
Answered by hotelcalifornia
2

Answer:

The correct answer is “string s1 = null”.

In the above answer, string is the data type, s1 is the variable and null is a keyword indicating no value. The first option: string s2 = ‘null’ is wrong because null is never specified in quotes. Third option: string s4 = (string) '\ufeed' is wrong as a primitive char data type cannot be cast to String (object). Fourth option: string s3 = (string) 'abc'; is wrong as well as multiple characters are between the quotes.

Similar questions