Difference between Scala’s Int and Java’s java.lang.Integer? What is the relationship between Int and RichInt in Scala?
Answer Posted / Jeetender Pal Singh
Scala's 'Int' is an integral type, while 'java.lang.Integer' is a class representing an integer value in Java. In Scala, 'Int' is more efficient as it's an immutable primitive type. 'RichInt' is a trait that provides many useful methods for working with integers, such as comparison and arithmetic operations.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers