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 java and its types?
What Is Composition?
Can a top level class be private or protected?
How does thread synchronization occurs inside a monitor?
Explain about map interface in java?
What are parsing rules?
What are the advantages and disadvantages of reference counting in garbage collection?
What is the difference between the ">>" and " >>>" operators in java?
How you can force the garbage collection?
How do you escape json?
What is == and === in javascript?
Is static a keyword in java?
What is your platform’s default character encoding?
Can You Have Virtual Functions In Java?
What is the difference between an if statement and a switch statement?