Difference | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

Difference

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

20th Jul 2017, 5:42 AM
Shamanth Rai
Shamanth Rai - avatar
3 Respostas
+ 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