About Question enthuware.ocpjp.v8.2.1667 :
Posted: Tue Apr 17, 2018 5:09 am
Hi everybody,
I have a question with
I understood that you should always put L or l when creating a long from a literal because by default the numerical literals (without decimal) are int.
When is necessary put L or l in literals to create long vars?
Thanks in advance.
I have a question with
Code: Select all
public class TestClass {
public static void main(String[] args) {
int x = 1____3; //1
long y = 1_3; //2
float z = 3.234_567f; //3
System.out.println(x+" "+y+" "+z);
}
}
When is necessary put L or l in literals to create long vars?
Thanks in advance.