Java Catcha
Here are some useful java got-ya that I found out during works, may be useful for interviews
Null Pointer Exception
All statements below will create NPE
int value = (int) null;
float value = (float) null;
Java constructors
- Normally when no constructor is defined, you have access to an emptry constructor automatically. However when you do define a constructor, that implicit constructor is gone
- In an inheritance scheme, the call
super()
is implicitly called