String name=adminname.getText(); String password=adminpassword.getText(); if(name="anoop" && password="sharma") { JOptionPane.showMessageDialog(rootPane, "Login successfull"); }
if(new String("test").equals("test")) { // Expression is true } if(new String("test") == "test") { // Expresson is false since you are not comparing // the same instance of the object to itself }
String name=adminname.getText(); String password=adminpassword.getText(); if(name=="anoop" && password=="sharma") { JOptionPane.showMessageDialog(rootPane, "Login successfull"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)