The answer should be good but it always gives output bad, I have tried everything Here is the code :
import java.util.*;
public class stringuses {
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
String str=new String("i am ayush");
System.out.println("Who am i ?");
String ans=sc.nextLine();
if(str==ans)
{
System.out.println("good");
}
else
{
System.out.println("bad");
}
}
}