Skip to content

Tag Archives: Java-Abstract Class and Interface

Interface contains only abstract methods that can’t be instantiated and it is declared by keyword interface. A class that is declared with the abstract keyword… Read More
In Java, the interface is called a blueprint of a class and it is used to achieve abstraction in java. By using interfaces only we… Read More
An abstract class is a class declared with an abstract keyword. Properties of an abstract class: An abstract can have an abstract and non-abstract method.… Read More
Abstract class, we have heard that abstract class are classes which can have abstract methods and it can’t be instantiated. We cannot instantiate an abstract… Read More
Prerequisite: Interface and Abstract class in Java. A Constructor is a special member function used to initialize the newly created object. It is automatically called… Read More
Abstract Class: An abstract class is a type of class in Java that is declared by the abstract keyword. An abstract class cannot be instantiated… Read More
Data Abstraction is the property by virtue of which only the essential details are displayed to the user. The trivial or the non-essentials units are… Read More
Predict the output of the following program. abstract class demo {     public int a;     demo()     {         a = 10;     }        abstract public void set();… Read More
Which of the following is true about interfaces in java. 1) An interface can contain following type of members. ....public, static, final fields (i.e., constants)… Read More
Which of the following is FALSE about abstract classes in Java (A) If we derive an abstract class and do not implement all the abstract… Read More
In C++, if a class has at least one pure virtual function, then the class becomes abstract. Unlike C++, in Java, a separate keyword abstract… Read More