Skip to content

Instantly share code, notes, and snippets.

@cerealcable
Created June 23, 2011 16:18
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Null tests
import java.util.Map;
public class Main {
public static void main(String[] args) {
Map<Object,Object> map;
if(map == null) {
System.out.println("test");
}
}
}
/**
* The attempt a compilation
javac Main.java
Main.java:9: variable map might not have been initialized
if(map == null) {
^
1 error
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment