Tuesday, June 8, 2021

Concepts in java

 What is the difference between equals () and == operator?

== checks if both references points to same location or not. equals() method should be used for content comparisonequals() method evaluates the content to check the equality.

What is meaning of ++ i?
++i means pre increment it means first value is incremented and then printed. i++ means post increment it means first the value of i is printed and then incremented.

What is the difference between equals () and == operator?

== checks if both references points to same location or not. equals() method should be used for content comparisonequals() method evaluates the content to check the equality.

What is meaning of ++ i?
++i means pre increment it means first value is incremented and then printed. i++ means post increment it means first the value of i is printed and then incremented.

No comments:

Post a Comment