I would be grateful if someone could explain these three doubts connected with the OCA exam.
1) Literals vs. FLOAT, DOUBLE, LONG
Somewhere I found info that 'float' needs 'f' after literal. That 'long' needs 'l' after literal. That in case of 'double' it is optional to add 'd'.
But is there any difference in concept when we consider primitive vs. wrapper class? I ask because during going through practice exams sometimes I saw, for example, 'long'/'Long' (don't remember) without additional 'l'/'L' at the end of literal. Maybe there is even another cause of such situation? Maybe auto-boxing?
2) static Integer or static int - When it needs to be initalized?
I know that when we have static variable in interface, it must be initialized in declaration line / in initialization code block / in constructor.
If we have a class variable (not instance, not local) as far as I remember, it is also necessary to initialize it early, exactly in declaration line (I think).
Then what if we have an instance variable with 'static' and it is not initialized in declaration line? When we have to initialize it? Does it change anything if we consider primitve type vs. wrapper class?
3) import static
I have some problem here. I thought that using wildcard in the case of import static is not allowed (that you have to indicate exactly the method or the variable). But yesterday I saw an example where there was a '*' (wildcard) symbol involved.
Thank you in advance for your time.