Hmm a simple code i dont understand whats wrong plz help...
Here's the code:
import java.awt.*;
import java.util.Scanner;
class Halt{
publicstaticvoid main (String[] arg){
Scanner scan =new Scanner (System.in);
System.out.print("Halt! Who goes there? "); System.out.flush();
String s = scan.nextLine();
if (s =="tor"){
System.out.println("You may pass tor!");
}
else{
System.out.println("You are not permitted to go here, " + s +"!");
}
}
}
The problem is that it prints the "you are not premitted" thing even if I input "tor"?
I don't understand whats wrong plz help...

