Difference | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Difference

What is the difference between == and .equals()

20th Jul 2017, 5:42 AM
Shamanth Rai
Shamanth Rai - avatar
3 Answers
+ 7
Primitive types are the most basic data types available within theJava language. There are 8: boolean , byte , char , short , int , long , float and double . These types serve as the building blocks of data manipulation in Java. Such types serve only one purpose — containing pure, simple values of a kind.💮💮💮💮💮💮💮💮💮💮💮💮💮
21st Jul 2017, 6:34 AM
Art456
Art456 - avatar
+ 6
the difference between == and equals in Java is that "==" is used to compare primitives while equals() method is to check equality of objects. String comparison is a common scenario of using both == and equals method.
20th Jul 2017, 5:44 AM
Art456
Art456 - avatar
+ 3
what are primitives and why they are called so @ArtemisAthena456?
20th Jul 2017, 7:49 AM
Shamanth Rai
Shamanth Rai - avatar