Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
String Literals

Java Language Specification, Version Java SE 21 Edition
3.10.5. String Literals

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.10.5

4 Documented Misconceptions

Misconception
LiteralString
When passing a literal string as argument to a method, no quotes are needed
Misconception
NoCallOnStringLiteral
One cannot invoke methods on String literals
Misconception
SingleQuoteString
String literals can be in single quotes
Misconception
StringLiteralNoObject
One needs to call the String constructor to get a String object from a literal

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors