+ 1

What is literals in java??

22nd Jun 2018, 7:39 PM
Abhijeet Anand
Abhijeet Anand - avatar
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
22nd Jun 2018, 8:03 PM
Dan Walker
Dan Walker - avatar
+ 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
21st Sep 2018, 2:56 PM
Sunil Chauhan
Sunil Chauhan - avatar