79074918

Date: 2024-10-10 14:36:04
Score: 1
Natty:
Report link

String class has only compareTo method. Because whenever we declare string as literal or by new operator it always create object of string class. no need of compare method here.

Integer class has both compareTo and static compare method. Because integer can be define primitive(int) as well as wrapper(Integer). if we don't have static compare method how it will compare.

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: kanik