+ 1
What is literals in java??
2 Respuestas
+ 3
literal is something that is 'literally' stated. You can pass around Strings and numbers like
int age = person.getAge()
where you are passing ints around, or you can declare it literally:
int age = 1;
1 is the literal,
String name = "Alice";
Alice is a string literal
+ 1
literals are constants that are assigned to variables.There are 7 literals:
1.fixed point literal
2.floatinting literal
3.boolean literal
4.character literal
5.string literal
6.null literal
7.class literal