Fundamentals of Java Programming

Before you run your first program you must know some concept related to object-oriented programming. So, let me introduce to you some of the fundamentals of Java programming.
  • Object: -
Objects are the runtime entities. It can be anything in the real world. Object is referred as the instance of the class.
  • Class: -
Class is a collection of the objects. For example, if fruit is a class the mango is its object. The class defines the structure and behavior that a set of objects will follow. It provides you with blank slate for you to construct logical structure.

  • Data Abstraction: -

Data abstraction is the property that hides unnecessary details. We manage complexity through abstraction. For example, you watch television, while watching television you don’t consider it as a set of individual components that comprise a TV set.
You think it as a unit that can be used as a source of entertainment. You don’t need to understand the working of each component for using it; you can simply ignore it. Similarly, java allows you to construct programs with abstraction. You can break complex systems into smaller components.
  • Data Encapsulation: -

Data encapsulation is the property of wrapping up data into a single unit, and protects code and data from outside interference and misuse. It can be thought as a wrapper that protects your code and data from being accessed from the outside code.
  • Inheritance: -

Inheritance is the property in which one class (and the objects in it) inherits the properties and methods of another class.

The base class is the class that shares its properties with another class. The other class that inherits the properties is said to be derived class.

  • Polymorphism: -

Polymorphism is the property that means taking more than one form it implies “one interface, multiple methods”. It means objects can work differently in different instances.
For example, the electricity can be used for various purposes. The same electricity can be used for starting computers, TV sets, microwaves and other electrical appliances. Hence electricity takes different forms at different situation!
Previous
Next Post »