Even though there is a lot of theory left to completely understand a java program; many of us prefer practical learning. So let’s write our first java program and then take a closer look at it.
As I told earlier, there are three basic steps in getting things done in an object oriented language.
Defining what you want out of an object – creating the class
Constructing the object – instantiation of the class
Doing whatever you need to – invocation of methods on the object.
Let’s assume that we want an object to greet us whenever we meet it. Think about it. What should be done to come up with such an object? List down the steps involved in creation of this object.
1.
2.
3.
HOLD ON! Please think about the implementation before reading further. This is not an optional exercise. If you couldn’t think about it, re-read the previous posts and attempt it. The solution follows in the next post.
Monday, March 12, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment