// Helene Martin, CSE 142 // User input text can be used to make decisions // == does not work for Strings, though! import java.util.*; public class StringComparison { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("What is your name? "); String name = console.next(); System.out.print("What is your age? "); int age = console.nextInt(); // String comparison methods evaluate to type boolean (true or false) // we can combine their results with other tests if (name.equalsIgnoreCase("Lance") && age > 40) { System.out.println("Pain is temporary."); System.out.println("Quitting lasts forever."); } } }