If Statements
Lesson 15Author : 🦒
Last Updated : October, 2017
if(isStudent && isSmart){ System.out.println("You are a student"); } else if(isStudent && !isSmart){ System.out.println("You are not a smart student"); } else { System.out.println("You are not a student and not smart"); }
// >, <, >=, <=, !=, ==, String.equals() if(1 > 3){ System.out.println("number comparison was true"); }
if('a' > 'b'){ System.out.println("character comparison was true"); }
if("dog".equals("cat")){ System.out.println("string comparison was true"); }