Well, the class is simply a construct that Java uses to define an object. Also, the concept of object is well defined in Java which makes it easier for the programmer to know what can and cannot be done. In Python, it is not as explicit. Java is a programming language and hence cannot be compared directly to a scripting language such as Python or PHP. These 2 types are designed for different purposes. - Asad On Fri, 6 Jan 2006, bruno desthuilliers wrote:
Rocky Burt wrote:
David H wrote:
Python is also object oriented. In python, x = 10 creates an object not a simple type - if I recall the same is true in Java.
In fact this is not quite right. In java, int x = 10 produces a primitive type. Not a class instance at all. In this case x has no methods which can be invoked whatsoever. This is something I always despised about Java. Java does have an "Integer" class but that is generally only used when an object is absolutely required (which is not often). Java 1.5 did introduce autoboxing on primitive types so that int's and Integer instances could be interchanged without knowing in method calls, etc ... but x is still not an object with methods.
In fact I'd go as far as to say that Python seems *more* object-oriented than Java.
s/seems/is/
Java is more class-oriented than object-oriented. It forces you to use classes for everything, but not everything is an object. Python let you use the paradigm that seems appropriate for the task at hand, but still everything is an object (really everything : functions, classes and modules too...)
-- bruno desthuilliers développeur bruno@modulix.org http://www.modulix.com _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )