crackyourinterview.com


To improves our performance please Like Share Subscribe(Will boost us)

Can we create a instance of abstract class object
Question Posted on 19 Dec 2011Home >> OOPS >> CLASS >> Can we create a instance of abstract class object

As all of us know abstract method have not any implementation they have only declartion as in below example we have two constructor and one declartion of method sum nad below is another class where we try to create its instantiate and we will get error

Example:-
public abstract class absexample
{
  public absexamplel()
  {
  }
  public absexample(int i)
  {
  }
  public abstract int sum(int i, int j);
  }

public class classtwo
{
  absexample a; // we can create object of abstract class
  a = new absexample() //Here we get error we not instantiate object of abstract class.
}

All of us know abstract method are only for declartion not for implemention so calling such function is meaningless. So it is not allowed to instantiate abstract class
0
0




.


Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions

difference between classes and struct

Function or Method Overload Ways with Example

Types of Inheritance OOPS

Can we create a instance of abstract class object

what is constructor and its types with example






@2014-2022 Crackyourinterview (All rights reserved)
Privacy Policy - Disclaimer - Sitemap