Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 
CreamKids


Can we create a instance of abstract class object
Question Posted on 19 Dec 2011

Home >> 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



 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


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






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |