GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  Programming  >  Java Classes
Go To First  |  Previous Question  |  Next Question 
 Java Classes  |  Question 62 of 68    Print  
Can a abstract class have a constructor ?When would the constructor in the abstract class be called ?
All the classes including the abstract classes can have constructors.Abstract class constructors will be called when its concrete subclass will be instantiated.


  
Total Answers and Comments: 2 Last Update: December 27, 2006     Asked by: devs 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 19, 2006 06:33:32   #1  
Amar        

RE: Can a abstract class have a constructor ?When woul...
constructor can not be created in an abstract class.even though we write the constructor when the constructor will be called..?only if the object is created. but we cannot create an object of abstract class.even though we create object using indirect way there also we cannot call the constructor of the abstract class.finally constructor for the abstract class cannot be called.
 
Is this answer useful? Yes | No
December 26, 2006 14:56:22   #2  
Sonal A. Watane        

RE: Can a abstract class have a constructor ?When woul...
yes we have constructor in abstract class.An abstract class may have constructors to initialize methods or pass values along to base class constructors.
 
Is this answer useful? Yes | No

 Related Questions

A) TrueB) False 
Latest Answer : flase ...

A) TrueB) False 
Latest Answer : trueA class is a template for multiple objects with similar features ...

A) ObjectB) ClassC) Instance D) None of the above  
Latest Answer : class ...

A) ObjectB) ClassC) Instance D) None of the above 
Latest Answer : The answer can also be instance variables as they are also defined inside a class althought they can belong to objects in particular. ...

A) TrueB) False 
Latest Answer : truemembers of a class may include methods and variables.They can easily invoked by an object reference. ...

A) TrueB) False 
Latest Answer : I think it is true. Because, we use initalize some variables which are not dynamic.For eg: int i = 10; ...

In this example class-var = new classname( ); class-var is a variable of the class type being created
A) TrueB) False 

A) TrueB) False 
Latest Answer : true ...

A) oneB) TwoC) ThreeD) FourExplanation: Obtaining objects of a class is a two-step process. First, you must declare a variable of the class type. This variable does not define an object. Instead, it is 
Latest Answer : two step process ...

In this example class-var = new classname( ); The classname is the name of the class that is being instantiated.
A) TrueB) False 


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

ODP.NET - Fundamental ODP.NET Classes to Retrieve Data

ODP NET Fundamental ODP NET Classes to Retrieve Data To retrieve data from an Oracle database using ODP NET we need to work with a few of the ODP NET classes At this point we will discuss the most fundamental classes available in ODP NET for retrieving data mosgoogle The following is the list of fun
 

Microsoft AJAX Library - C# and JavaScript Classes

C and JavaScript Classes For the purpose of demonstrating a few more OOP related concepts we ll use another class Our new class is named Table and it has two public fields rows columns and one method getCellCount The getCellCount method should return the number of rows multiplied by the number of co
 

Microsoft AJAX Library - JavaScript Classes

JavaScript Classes Not only can JavaScript functions contain other functions but they can also be instantiated This makes JavaScript functions a good candidate for implementing the concept of a class from traditional object oriented programming This is very helpful feature indeed because JavaScript
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ Storage Classes

C Storage Classes In this C tutorial you will learn about storage classes types of storage class variables Automatic External and Static explained with examples mosgoogle center Storage classes In the context of scope of variables in functions exists the important concept of storage class What is St
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

C++ Objects and Classes

C Objects and Classes An Overview about Objects and Classes In object oriented programming language C the data and functions procedures to manipulate the data are bundled together as a self contained unit called an object A class is an extended concept similar to that of structure in C programming l
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape