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
How many classes can any class inherit java?
What about static nested classes in java?
How to sort a collection of custom Objects in Java?
What is hashmap in java?
Can memory leak in java?
What is the scope or life time of instance variables?
What does int argc char * argv [] mean?
What is compareto?
How are this() and super() used with constructors in java programming?
Can we overload the main() method?
Is map ordered in java?
Can an interface extend another interface?
What is a java string?
Write a program based on Java script program.
Can you pass by reference in java?