whats the difference between == and .equal ?
Answer Posted / nagaraju
== it is relational operator to copares the values
.equals() is a method to compares the two strings whether
they are equal or not.
if(a==b)
System.out.println("both are equal");
object.equals(string1,string2)
System.out.println("strings are same");
| Is This Answer Correct ? | 24 Yes | 6 No |
Post New Answer View All Answers
Explain creating threads by implementing runnable class?
How do you start a thread?
What are data types in programming?
Can a set contain duplicates?
Is a class an object?
What is the difference between the direct buffer and non-direct buffer in java?
What is a pattern what is an anti pattern?
What is the difference between the paint() and repaint() methods in java programming?
How does linkedlist work in java?
Can main() method in java can return any data?
What is the core java?
What is the size of arraylist in java?
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.
Is boolean a wrapper class in java?
How many ways can we create singleton class?