Null tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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