Last active
August 29, 2015 14:22
-
-
Save moshekarmel1/64d18319619d51c1e074 to your computer and use it in GitHub Desktop.
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
List<Object> myList = new ArrayList<>(); | |
//This line will throw an ERROR incompatible types required: boolean found: List<Object> | |
if(myList){//basically you need a boolean expression inside the if... | |
} | |
if(myList != null){//works fine because checking against null returns a boolean | |
//do stuff | |
} | |
//the one trick you can do, is to check for a truthy boolean | |
boolean bool = true; | |
if(bool){ | |
//this code will get run even without checking for (bool == true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment