Understand Objects, Understand Java
Java is an object oriented programming language developed by Sun Microsystems in the early 1990s. Here are the 5 strengths of Java.
- uses object oriented programming methodology
- allows the same program to be executed in different operating systems
- contains built in support for using computer networks
- designed to execute code from remote resources securely
- easy to use by selecting good parts of other object oriented languages
Java is an interesting programming language that I’ve learned to use when I was in university. I guess I liked it cause my lecturer was a professor from German. His extradordinary ability to explain the most complex language into super simple daily examples is a wonder. Thanks to him, I can now explain Java in very simple terms.
Let’s look at the world around us. I’ll take my place as an example. I am now in my room and there’s a lamp above the monitor. There are 2 states where it can be, which is on and off. There are also 2 behaviours, the process of turning on and turning off. Let’s take a while and look around. Seek answers to these 2 questions :
- What states can the object be in?
- What behvaious can the object be in?
Once you’ve understood real world objects, you’ll understand software objects. They are exactly the same. Software objects stores its state in fields and exposes its behaviours in methods. Usually the stored states are hidden. Why? Because it will control how the object is being used. I know that I can’t control the brightness of my lamp. There is no way to do it and attempting to do it will only end up in rejection. We just need to know what we need to do (press the switch to on or off), which is why the switch (methods) is exposed.
There you have it. Basics of Java in very simple terms. =)
Source for java development