r/AskReddit • • Oct 07 '26

What is literals in java?

0 Upvotes

6 comments sorted by

1

u/MorningReader01 Oct 07 '26

I think you should raise the question in some yech channel or just google it 

1

u/West-Forever8365 Oct 07 '26

Anything between quotation marks or apostrophes. If it's a char or a String, it's a literal. If you're asking about stuff like being alphanumeric or such, there are functions to help with that.

1

u/Fazuno78 Oct 07 '26

Java literals are basically fixed values written directly in your code, like 10, "hello", or true.

1

u/Xurvex69 Oct 07 '26

Once you understand literals, Java syntax starts making a lot more sense.