Can we compare two strings in java?



Can we compare two strings in java?..

Answer / Umesh Chandra

Yes, you can compare two strings in Java using equality operator (==), equals() method or by comparing their lexicographic order with comparison operators like >, <, >=, <=.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Discuss 2D arrays.

1 Answers   Amdocs,


explain about casting of objects?

5 Answers  


What are static methods?

1 Answers  


Who developed java?

1 Answers  


What is sortedmap interface?

1 Answers  


Can an interface be defined inside a class?

1 Answers  


Which list is sorted in java?

1 Answers  


What is lexicographically smallest string?

1 Answers  


Say any two properties in beans?

1 Answers  


Can we have 2 main methods in java class?

1 Answers  


What is the difference between a vector & an array list?

1 Answers   Agilent,


Why are constructors used?

1 Answers  


Categories