JCQ Java

Wednesday, September 06, 2006

Java and OOP

Java is a programming language. Besides being platform-independent, Java supports Object-Oriented Programming (OOP). This brings up the following questions:

* What is Object?
* What is Object-Oriented?
* What is Object-Oriented Programming?


So there are 3 questions for just one concept: OOP!

I won't try to answer all these questions at once. In fact, without going into the details of Java programming, I cannot answer these questions fully. Just keep these questions in mind. In due course, you'll find the answers. And by that time, you'll know Java.

I just want to relate these questions to the applets you are playing.

Using the mouse, you can turn the 3-dimensional molecule around. It is fun, isn't it?

This is an example of an object -- something you can touch and manipulate.

However, this is a software object -- not a real one. Real molecules are too small to touch and turn. The Java program creates a software object that simulates the real one, and let you touch and turn it.

Software objects can simulate anything: real ones, imaginary one, even those you never think in terms of objects. For example, the Java program itself is an object -- that's why Java is OOP. However, you cannot touch or turn a Java program.

Since we shall be talking Java, "objects" always means "software objects" from now on.

Some objects (e.g. the simulated molecule) you can turn, but some objects (e.g. the Java program) you cannot turn. What do Java objects have in common?

0 Comments:

Post a Comment

<< Home