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 does the string method compareto () do?
Can size_t be negative?
What is the difference between inheritance and encapsulation?
Describe the syntax of multiple inheritance? When do we use such an inheritance?
What is final class?
Which variable is the independent variable?
How do I print a “?
What is a class object?
What is the benefit of using enum to declare a constant?
What is a default method?
Write a program to search a number in the given list of numbers.
What is output buffer?
Is object a data type?
What are the differences between string, stringbuffer and stringbuilder?
Is java developer a good career?