CODING:
import javax.swing.JOptionPane;
class string
{
public static void main(String[] args)
{
String s1=JOptionPane.showInputDialog(null,"Enter Your Name1");
String s2=JOptionPane.showInputDialog(null,"Enter Your Name2");
if(s1.equals(s2)){
JOptionPane.showMessageDialog(null,s1 + " equals " + s2);
}
else{
if(s1.equalsIgnoreCase(s2)){
JOptionPane.showMessageDialog(null,s1 + " equals " + s2 + " but Case Different");
}
else{
JOptionPane.showMessageDialog(null,s1 + " not equals " + s2);
}
}
}
}
class string
{
public static void main(String[] args)
{
String s1=JOptionPane.showInputDialog(null,"Enter Your Name1");
String s2=JOptionPane.showInputDialog(null,"Enter Your Name2");
if(s1.equals(s2)){
JOptionPane.showMessageDialog(null,s1 + " equals " + s2);
}
else{
if(s1.equalsIgnoreCase(s2)){
JOptionPane.showMessageDialog(null,s1 + " equals " + s2 + " but Case Different");
}
else{
JOptionPane.showMessageDialog(null,s1 + " not equals " + s2);
}
}
}
}
Comments
Post a Comment