English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

Yes Java is a pure object oriented programing language.
The reason is that is providing to the programmer the three object oriented concepts:

inheritance=a mechanism for creating subclasses, inheritance provides a way to define a (sub)class as a specialization or subtype or extension of a more general class: Dog is a subclass of Canidae, and Collie is a subclass of the (sub)class Dog. A subclass inherits all the members of its superclass(es), but it can extend their behaviour and add new members. Inheritance is the "is-a" relationship: a Dog is a Canidae.

encapsulation=ensuring that code outside a class sees only functional details of that class, but not implementation details. The latter are liable to change, and could allow a user to put an object in an inappropriate state. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface — those members accessible to that class.

polymorphism=polymorphism is behavior that varies depending on the class in which the behavior is invoked, that is, two or more classes can react differently to the same message.

Also except from the three concepts is also the ability to use classes to create objects. C for example uses structs to create an item that is similar to an object. Is not the same since classes have different capabilities that structs.

For more information check
http://www.mindview.net/ Bruce Eckel is explaining object oriented programing very good.Is book is great for beginners

http://www.javaworld.com/javaworld/jw-04-2001/jw-0406-java101.html
http://en.wikipedia.org/wiki/Object-oriented_programming

2006-07-05 07:59:44 · answer #1 · answered by disk_tel 4 · 0 0

Yes it is, all code must be part of an object.

2006-07-05 07:45:07 · answer #2 · answered by John J 6 · 0 0

fedest.com, questions and answers