CSE Dept Engineering Topics List

Inheritance, Packages and Interfaces | Object Oriented Programming

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

Inheritance is a mechanism in which the derived class borrows the properties of the base class.

Definition, Concept, Syntax, Implementation, Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

Multiple inheritance is a mechanism in which the child class inherits the properties from more than one parent classes.

with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

The interface is a powerful tool. The same interface can be used by different classes for some method. Then this method can be implemented by each class in its own way.

with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

It is necessary to create a class for every interface.The class must be defined in the following form while using the interface

Object Oriented Programming

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

The access_modifier specifies the whether the interface is public or not. If the access specifier is not specified for an interface then that interface will be accessible to all the classes present in that package only.

Purpose, Definition, Importance, Creating, Accessing, Importing, Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

In Java, packages are used to achieve the code reusability. That means, the classes from other programs can be easily used by a class without physically copying it to current location.

Definition, Concept, Syntax | Interfaces

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

Java has a facility of automatic garbage collection. Hence even though we allocate the memory and then forget to deallocate it then the objects that are no longer is used get freed.

with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

A variable can be declared as final. If a particular variable is declared as final then it cannot be modified further. The final variable is always a constant.

with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

In inheritance hierarchy, the superclass is very general and less specific. This class does nothing but only specifies the member functions that can be used in hierarchy. Such a class is called abstract class.

with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

Basic concept: Polymorphism is a mechanism which allows to have many forms of the method having the same name.

with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

Method overriding is a mechanism in which a subclass inherits the methods of superclass and sometimes the subclass modifies the implementation of a method defined in superclass.

Syntax with Example Java Programs

Subject and UNIT: Object Oriented Programming: Unit II: Inheritance, Packages and Interfaces

Super is a keyword used to access the immediate parent class from subclass. There are three ways by which the keyword super is used.