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
What is the purpose of a parameter?
Can we write multiple catch blocks under single try block?
Can we increase size of array?
Does importing a package imports its sub-packages as well in java?
Why do we use bufferedreader?
Which is illegal identifier in java?
What does a za z0 9 mean?
Can we make constructors static?
How to declare an arraylist in java?
Is string an object?
Can we override data members in java?
Can you access non static variable in static context?
How does class forname work in java?
What is the gregoriancalendar class in java programming?
what is the final keyword denotes in java?