My Java program isn't working!
Here is my code:
public class practice
public static void main(String args)
String userName = "Eddie"; //username is Eddie
String passWord = "hI"; // passsword is hI
name = JOptionPane.showInputDialog("Whats your username? ");
if (name == userName)
if (name == userName) should be changed to
Both equals() and "==" operator in Java is used to compare objects to check equality but main difference between equals method and == operator is that former is method and later is operator.
Read more here to identify the differences: http://javarevisited.blogspot.com/2012/12/difference-between-equals-method-and-equality-operator-java.html#ixzz44dFcXkwr