home / developersection / category
All of us have observed inheritance in nature. For example, a baby inherits the characteristics of her parents; a child plant inherits the characteristics of its parent plant, and so on.
To better understand the object-creation process, let’s begin with a simple case of two-level inheritance, where we have just a base class and its derived class.
In our example of the previous post, the classes Asset, BankAccount, and SavingsAccount defined two constructors. Both constructors obviously have the
In the previous post, we learned how to create a single-level class hierarchy of an arbitrary depth. We created an asset management system, and the top-level class in this system was Asset.
IntroductionA class is a template that encapsulates data and the methods that operate on this data, as in the Employee or Automobile class described e
Another big concept associated with object-oriented programming is encapsulation. Every class contains some data in its fields. We hide these fields by declaring them private. We define getter/setter methods to access them.
In our everyday life, many of us oftentimes try to hide information from other people. In many situations, the information hiding is an essential part of our life.
It is a good practice to provide a coupling between the data and the methods that operate on the data (method is another name for a function or a procedure, also called an operation).
So far, in previous posts, we have discussed the features of Java referring to its very first version, JDK 1.0. Over time, Java has grown and expanded a lot and has had many new features added to its repertoire.
Platform IndependentA major benefit that is derived out of the introduction of a JVM is the resulting platform independence for a Java executable. As
In my previous post, we have seen how java is so flexible and simple, while very small and yet equipped with powerful features like Object Oriented principles (OOPS).
The Java programming language was originated and developed at Sun Micro systems under the guidance of Net luminaries James Gosling and Bill Joy, was d