+ 6

What is literal in java

How

26th Nov 2019, 3:50 AM
Rameshwar Shivshette
Rameshwar Shivshette - avatar
8 odpowiedzi
+ 9
Literals are Compile time constant values that cannot be changed e.g String s = "a" // "a" is a string litetal, s is a variable As long as you use double quote it's string literal int x = 2; // 2 is an int literal, x is a variable
26th Nov 2019, 4:01 AM
Preity
Preity - avatar
26th Nov 2019, 12:20 PM
Hmd(inactive)
+ 6
Something like a constant.
26th Nov 2019, 3:58 AM
Sonic
Sonic - avatar
+ 6
Hope it is clear now.
26th Nov 2019, 6:15 AM
Sonic
Sonic - avatar
26th Nov 2019, 5:18 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Thanku.. But I didn't get clarity..
26th Nov 2019, 4:05 AM
Rameshwar Shivshette
Rameshwar Shivshette - avatar
+ 2
Yes
26th Nov 2019, 6:19 AM
Rameshwar Shivshette
Rameshwar Shivshette - avatar
0
int a=5; 5 is a literal for int char a='j'; j is literal
26th Nov 2019, 10:43 AM
Tarun R Jain
Tarun R Jain - avatar