import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Choose your gender:"); Scanner sc=new Scanner(System.in); String gender=sc.nextLine(); if(gender=="female") {System.out.println("Hi"); } else{ System.out.println("sorry"); } } }
==
gender.equals("female")
gender == "female"
System.exit(0)
true
gender
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)