According to
JLS - 3.10 Literals, "A
literal is the source code representation of a value of a primitive type (�4.2), the String type (�4.3.3), or the null type (�4.1)..."
Basically, when you specify a
specific value in your code for these types, that is a literal. Using your example of
String s = "ok"; the "ok" is a String literal. The variable 's' is assigned a reference to a String object representing that literal.