Okay, im using netbeans as my compiler. And don't judge me for my text. Im new and im just texting stuff. I can't get my Scanner to work with a String. last thing on the code, i got a School variable that i want to set to Good or Bad. And i want to use the (true/false if statement) But i keep getting errors. So, if anyone could just have a quick look at it, it would really help me
Thx!
package tester; import java.util.Scanner; public class Tester { public static void main(String args[]) { int age, sex; String School = "Good"; Scanner scan = new Scanner(System.in); System.out.println("What's your sex?"); System.out.println("[1] Male [2] Female"); sex = scan.nextInt(); System.out.println(sex == 1 ? "A guy huh." : "A woman huh."); System.out.println("What's your age?"); age = scan.nextInt(); System.out.println(age >= 23 ? "No school? Nice!" : "Still in school... That's boring"); if (age <= 22){ System.out.println("How is your school? Good or bad?"); School = scan.nextString; System.out.println(School == Good ? "How nice" : "Aww, that's sad"); } } }