Which of the following correctly declares a String in Java?

Java Associate Easy

Java Associate — Easy

Which of the following correctly declares a String in Java?

Key points

  • In Java, Strings are declared using double quotes.
  • The 'String' keyword must be capitalized.
  • Using the 'new String()' constructor is unnecessary for String literals.

Ready to go further?

Related questions