Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


how do i compare two string objects??

Muneeb AhmedMuneeb Ahmed Member Posts: 1

here is the code of my scenrio:
String st1=new String("<"); String st2=new String(">"); String keyboard=new String("<"); String keyboard1=new String(">"); if(st1.equal(keyboard)){ System.out.println("it is less than operator:"); } else if(st2.equal(keyboard1)){ System.out.println("it is greater than operator:"); } else{ System.out.println("it is not relop operator"); }

it gives me the wrong answer what am i missing.thanks for reading and helping in advance.


Sign In or Register to comment.