Answer Posted / interviewall
If string a="aaaa"; and String b="bbbb";
we can compare them as
if(a.equals(b)) and get a boolean as a return type.
////////////////////////////////////////////////////////
We can also compare String as
a.compareTo("aaaa"); which gives 0 as output as they are
equal.
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
Which graphs are functions?
In the below example, what will be the output?
Detail discussions on JVM, memory management and garbage collector.
Difference between comparator and comparable in java?
What is static in java?
What is the method to declare member of a class static?
What happens if an exception is throws from an object's destructor?
Why use string handling in Java?
What happens when a thread cannot acquire a lock on an object in java programming?
Can you give few examples of final classes defined in java api?
What is ctrl m character?
what is meant by Byte code concept in Java?
Can you sort a list in java?
What is int short for?
Why is flag used in java?