5 years ago in Java Strings

Which is a valid declarations of a String?

[A] String s1 = null;
[B] String s2 = 'null';
[C] String s3 = (String) 'abc';
[D] String s4 = (String) '\ufeed';
Loading...
Next Question

Overall Stats

Attempted 333
Correct 102
Incorrect 95
Viewed 136

Answers

Guest
Guest
bruh
bruh - 4 weeks ago

bruh from Guwahati, India is saying String s3 = (String) 'abc'; is correct answer

Assaad Amine
Assaad Amine - 4 weeks ago

Assaad Amine from Casablanca, Morocco is saying String s1 = null; is correct answer

Zo Go
Zo Go - 4 weeks ago

Zo Go from Casablanca, Morocco is saying String s1 = null; is correct answer

Vaibhav Bisht
Vaibhav Bisht - 4 weeks ago

Vaibhav Bisht from Dehradun, India is saying String s2 = 'null'; is correct answer

Awa Kone
Awa Kone - 4 weeks ago

Awa Kone from Berrechid, Morocco is saying String s1 = null; is correct answer

Related Questions

Which of the following statements are incorrect?

  • [A] String is a class
  • [B] Strings in java are mutable.
  • [C] Every string is an object of class String.
  • [D] Java defines a peer class of String, called StringBuffer, which allows string to be altered.