Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Best practice for Null check in Java
- if(test ! = null)
- if(null != test)
- // no compiler complaint at all for C/C++
- // while in Java, this is illegal.
- if(a = 2) {
- }
- // this is illegal in C/C++
- // and thus become best practice, from C/C++ which is not applicable to Java at all.
- if(2 = a) {
- }
- if("bla".equals(test))
- if(test.equals("bla"))
Add Comment
Please, Sign In to add comment