Originally posted by Jawahar Rajan:
Though Java does have primitive types such a int, char etc. it does provide wrappers like INTEGER which will behave like an object and can be instantiated and used as an object.
So does this help java to be closer to an OO language.
Primitives the obvious example, but primitives are not the only nonobjects in Java, say in comparison to Smalltalk.
For example, in Smalltalk an expression such as
( a < b )
is an object (an instance of True or False, which are subclasses of Boolean).
And in Smalltalk an arbitrary block of code enclosed in square brackets ([]) is an object that can be passed as a method parameter. An arbitrary block of code in Java (enclosed in curly brackets) is, well, an arbitrary block of code.
[ June 11, 2002: Message edited by: Michael Matola ]