Java Language Specification, Version Java SE 21 Edition
3.10.5. String Literals4 Documented Misconceptions
LiteralString
When passing a literal string as argument to a method, no quotes are neededNoCallOnStringLiteral
One cannot invoke methods on String literalsSingleQuoteString
String literals can be in single quotesStringLiteralNoObject
One needs to call the String constructor to get a String object from a literal