Difference | Sololearn: Learn to code for FREE!

+4

Difference

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

7/20/2017 5:42:02 AM

Shamanth Rai

3 Answers

New Answer

+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.💮💮💮💮💮💮💮💮💮💮💮💮💮

+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.

+3

what are primitives and why they are called so @ArtemisAthena456?