Author: admin
-
Java – Encapsulation
Java Encapsulation Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the…
-
Java – Abstraction
As per dictionary, abstraction is the quality of dealing with ideas rather than events. For example, when you consider the case of e-mail, complex details such as what happens as soon as you send an e-mail, the protocol your e-mail server uses are hidden from the user. Therefore, to send an e-mail you just need to type…
-
Java – Instance Initializer Block
Java Instance Initializer Block An instance initializer block is a block of code that is declared inside a class to initialize the instance data members. Instance Initializer block is executed once for each object and can be used to set initial values for instance variables. The instance initializer block is similar to the Java constructor but its execution and uses are are different. Java…
-
Java – Static Binding
Binding is a mechanism creating link between method call and method actual implementation. As per the polymorphism concept in Java, object can have many different forms. Object forms can be resolved at compile time and run time. Java Static Binding Static binding refers to the process in which linking between method call and method implementation is resolved at compile…
-
Java – Dynamic Binding
Binding is a mechanism creating link between method call and method actual implementation. As per the polymorphism concept in Java, object can have many different forms. Object forms can be resolved at compile time and run time. Java Dynamic Binding Dynamic binding refers to the process in which linking between method call and method implementation is resolved at run…
-
Java – Method Overloading
Java Method Overloading When a class has two or more methods by the same name but different parameters, at the time of calling based on the parameters passed respective method is called (or respective method body will be bonded with the calling line dynamically). This mechanism is known as method overloading. Advantage of Method Overloading Method overloading improves the…
-
Java – Overriding
In the previous chapter, we talked about superclasses and subclasses. If a class inherits a method from its superclass, then there is a chance to override the method provided that it is not marked final. Benefit of Overriding in Java The benefit of overriding is: ability to define a behavior that’s specific to the subclass…
-
Polymorphism
Polymorphism in Java Polymorphism is the ability of an object to take on many forms. Polymorphism is an important feature of Java OOPs concept and it allows us to perform multiple operations by using the single name of any method (interface). Any Java object that can pass more than one IS-A test is considered to be polymorphic.…
-
Java – Aggregation
Java Aggregation An aggregation is a relationship between two classes where one class contains an instance of another class. For example, when an object A contains a reference to another object B or we can say Object A has a HAS-A relationship with Object B, then it is termed as Aggregation in Java Programming. Use of Java…
-
Java – Inheritance
Java Inheritance In Java programming, the inheritance is an important of concept of Java OOPs. Inheritance is a process where one class acquires the properties (methods and attributes) of another. With the use of inheritance, the information is made manageable in a hierarchical order. The class which inherits the properties of other is known as subclass (derived class,…