Java Flashcards
1
Q
Is this following code valid:
float pi1 = 3_.1415F
A
Invalid, cannot put underscores adjacent to a decimal point
2
Q
Is this following code valid:
long socialSecurityNumber1 = 999_99_9999_L
A
Invalid: cannot put underscores prior to an L suffix
3
Q
Is this following code valid:
int x1 = 5_2;
A
OK
4
Q
Is this following code valid:
int x2 = 52_;
A
Invalid: cannot put underscores at the end of a literal
5
Q
Is this following code valid:
int x4 = 0_x52;
A
Invalid: cannot put underscores in the 0x radix prefix
6
Q
Is this following code valid:
int x5 = 0x_52;
A
Invalid: cannot put underscores in the 0x radix prefix
7
Q
Is this following code valid:
int x7 = 0x52_;
A
Invalid: cannot put underscores at the end of a number