What is the relationship between Base Class and Abstract Class ?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. What is the relationship between Base Class and Abstract Class ?Core Java
Ans. Abstract Class is a class that's only allowed to be a Base class for it's usage. It can never be instantiated on it's own.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     base class  abstract class      basic


Related Questions

 Difference between Base Class, Derived Class , Abstract Class and Concrete Class ?
  If there is a conflict between Base Class Method definition and Interface Default method definition, Which definition is Picked ?
  What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
  If a method definition has been specified in Class , its Base Class , and the interface which the class is implementing, Which definition will be picked if we try to access it using Interface Reference and Class object ?
  If a method definition has been specified in the Base Class and the interface which the class is implementing, Which definition will be picked if we try to access it using Interface Reference and Class object ?
 Will it print the message in Base Class constructor if we execute main method of Main class ? why ?

public class BaseClass {
BaseClass(){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
 What will the following print upon executing main method of Main class ?

public class BaseClass {
BaseClass(){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
System.out.println("Hello I am in Derived Class Constructor");
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
 What will the following code print upon executing main method of Main class ?

public class BaseClass {
BaseClass(){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
System.out.println("Hello I am in Derived Class Constructor");

super();
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}

 What will the following code print upon executing main method of Main class ?

public class BaseClass {
BaseClass(int x){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
System.out.println("Hello I am in Derived Class Constructor");
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}
 What will the following code print upon executing main method of Main class ?

public class BaseClass {
BaseClass(int x){
System.out.println("Hello I am in Base Class Constructor");
}
}

public class DerivedClass extends BaseClass{
DerivedClass(){
super(1);
System.out.println("Hello I am in Derived Class Constructor");
}
}

public class Main {

public static void main(String[] args) {
    DerivedClass derivedClass = new DerivedClass();
}
}



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: