16.5k views
11 votes
What is string literal in Java?

variable type that allows more than one character
group of printable characters enclosed within double quotation marks
group of printable characters enclosed within curly brackets
variable type that only allows for one character

User Shafiq
by
5.9k points

1 Answer

13 votes

Answer:

A string literal in Java is basically a sequence of characters from the source character set used by Java programmers to populate string objects or to display text to a user. These characters could be anything like letters, numbers or symbols which are enclosed within two quotation marks.

Step-by-step explanation:

User Carlos Rodriguez
by
5.5k points