is memory to the abstract class allocated ..or objects not
instantiated

Answers were Sorted based on User's Feedback



is memory to the abstract class allocated ..or objects not instantiated..

Answer / garima

for abstract class in java can not be directly instantiated
with new operator Because abstract class is not fully
defined.ie,it's meaningless to implement incomplete class
and Since "classname var =new classname();" is responsible
for allocating the memory ,hence there will be no memory or
object will be instantiated for abstract class.
But we can make reference to abstract class.
example Box b1;

Is This Answer Correct ?    16 Yes 0 No

is memory to the abstract class allocated ..or objects not instantiated..

Answer / swetha

no,since we cannot instantiate objects for an Abstract class
memory is not allocated for an abstract class

Is This Answer Correct ?    8 Yes 1 No

is memory to the abstract class allocated ..or objects not instantiated..

Answer / rashid

Abstract class object can no be created so memory is not
allocated for abstract class (or we can say class object)
but we can still call static methods of abstract class and
those static methods can you static member objects of that
class, right?

How do they get executed without memory allocation?

Is This Answer Correct ?    1 Yes 0 No

is memory to the abstract class allocated ..or objects not instantiated..

Answer / this:)

than who one allocate the memory to tha abstract class variable????

Is This Answer Correct ?    1 Yes 0 No

is memory to the abstract class allocated ..or objects not instantiated..

Answer / amit jayaswal

Actually the fact is this that abstract class is used to achieve polymorphism (abstraction 0-100) & for code sharing among closely related concrete classes, there are no need to create and object of abstract class direct using "new" operator, because there are some abstract method & nothing to be allocated for abstract method they are here only for abstraction and there are some another non abstract method (for code sharing) and attribute inside abstract class and memory will be allocated for those members on the basis of their belonging concrete class. while we invoke constructor of their concrete class then the constructor of abstract class will be invoke implicitly.

Is This Answer Correct ?    0 Yes 0 No

is memory to the abstract class allocated ..or objects not instantiated..

Answer / rishu

but according to my understanding ,objects of abstract
variables are create but memory can't be allocated as.the
memory of this points to null..we can say tht.objects of
abstract class can't be created.. am i right?

Is This Answer Correct ?    2 Yes 3 No

is memory to the abstract class allocated ..or objects not instantiated..

Answer / sekhar

For abstract classes we can't create an object directly
with the help of the new operator.So memory is not allocated
for abs classes.

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More Core Java Interview Questions

abstract class A{ int list []=new int [100]; A(int x,int y){ rondom n=new rondom(); for (int i==;i<100;i++); list [i]=x+r.next int(y-x+1); abstract sort (); abstract binary sarch(int temp); class B extends A{

3 Answers  


Hi, This is ravi i have a question like this i have string "UNDERSTAND" now i want to count the letters how many times it occures.i.e from the above string the out put should be like this U-1,N-2,D-2,E-1,R-1,S-1,T-1,A-1. how can i achieve this Thnaks in advance for your response ..

7 Answers  


How do you declare an array that will hold more than 64KB of data?

0 Answers   Aspire, Infogain,


What is predicate in java?

0 Answers  


What are the different tags provided in jstl?

0 Answers  






What is bitwise complement?

0 Answers  


Why Static variable required in java?For ex,class A { static int a; int b; } Why static is required?

5 Answers   Ericsson,


What are data structures in java?

0 Answers  


what is ststic with example

0 Answers   Wipro,


How a string is stored in memory?

0 Answers  


we know that every java prog must follows OOPS Principles. Anybody can answer, HOW THE FOLLOWING PROGRAM FOLLOWS OOPS CONCEPTS i.e, Inheritance,Polymarphism,Encapsulation? class a{ public static void main(String args[]){ System.out.println("Hello World"); } }

3 Answers  


If a method is declared as protected, where may the method be accessed?

0 Answers  


Categories