A

Admin • 828.03K Points
Coach

Q. Which of the following creates a string in Java?

  • (A) String s = 'hello';
  • (B) String s = "hello";
  • (C) String s = new char[5];
  • (D) String s = new String('hello');

Explanation by: Admin
String literals are enclosed in double quotes.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.