Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Is it compulsory to have atleast one abstract method in
abstract class?

Answers were Sorted based on User's Feedback



Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / gaurav agrawal

abstract class can have methods without abstract methods.
if someone dont konw the proper answer then please dont
give the answer.
this is not the proper way.

Is This Answer Correct ?    35 Yes 4 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / chellammal

No. It is not compulsory that an abstract class
should have atleast one abstract method.

One can declare a class as abstract still with full
implementation of methods. This avoids the instantiation
the class

Is This Answer Correct ?    34 Yes 7 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / saurabh m. chande

It is absolutely not necessary to have at-least 1 method as an abstract method in a class which is defined as an abstract.
But it is equally necessary to declare the class as an abstract class if at-least 1 method within that class is declared as abstract method.
Abstract class contains either the method declaration only or complete method implementation.

Is This Answer Correct ?    8 Yes 1 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / chandrasekhar.k

No,It is not mandatory, but sub class of abstract class
should be override by any one of the method from abstract
class .

Ex:i) javax.servlet.http.HttpServlet
ii) org.apache.struts.actions.DispatchAction, etc.,

Is This Answer Correct ?    8 Yes 4 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / jag

no we can have all concrete methods in abstract class
example:
all the methods in javax.servlet.HttpServlet class are
concrete but it is abstract class

Is This Answer Correct ?    4 Yes 1 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / jatin

NO,It is not mandatory to write abstract members in Abstract
Class. I Repeat <IT IS NOT MANDATORY> ,If anyone have doubt
regarding this than simply make a program then everything
will be cleared, FOR YOUR CLARIFICATION I AM MAKING 1 SIMPLE
PROGRAMME FOR U GUYS
HOPE U WILL ENJOY AFTER READING THIS ..

program in console application:

namespace ConsoleApplication1
abstract class absClass
{
//A Non abstract method
protected virtual int AddTwoNumbers(int a, int b)
{
return a + b;
}

}
class absDerived : absClass
{
protected override int AddTwoNumbers(int Num1, int Num2)
{
int n = Num1 + Num2;
Console.WriteLine("sum of method is:" + n);
return n;
}
static void Main()
{
//You can create an
//instance of the derived class
absDerived calculate = new absDerived();
int sum = calculate.AddTwoNumbers(10, 20);
Console.WriteLine("{0}", sum);
Console.Read();
}
}
}


All the best ... :)

Is This Answer Correct ?    4 Yes 2 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / srinu

No its not compulsory.
first of all Abstract class contain some defined methods or
undined methods or both or only defined methods.Because
Httpservlet contain purely undefined but it declared as a
Abstract class.so finally concluded is its a wrong opinion
for Abstract class contain at least one Abstract methods.

Is This Answer Correct ?    4 Yes 4 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / navya

Yes, it is compulsory to have atleast one abstract method
in abstract class

Is This Answer Correct ?    4 Yes 17 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / geetha

yes,whenever a class is defined as an abstract it should
have atleast one method as an abstract

Is This Answer Correct ?    5 Yes 20 No

Is it compulsory to have atleast one abstract method in abstract class? ..

Answer / krishna

yes it is very much compulsory to have a one abstract mthod
in abstract class
otherwise will be no longer abstract

Is This Answer Correct ?    7 Yes 33 No

Post New Answer

More Core Java Interview Questions

how to make hashmap object as synchronized object?

2 Answers   BOB Technologies,


Why does java doesnt suuport unsigned values?

0 Answers   ABC,


Hi ,i convert contrller as jSp And presentation as servlet ...will it do? if so what are advantage and idsadvantages

2 Answers   IBM,


What does java stand for?

0 Answers  


How does predicate work in java?

0 Answers  


Can we have multiple classes in a single file?

0 Answers  


What is java thread dump, how can we get java thread dump of a program?

0 Answers  


How does multithreading take place on a computer with a single cpu in java programming?

0 Answers  


What is tochararray in java?

0 Answers  


What are the different types of multitasking?

0 Answers  


How would overload a function based on return type?

0 Answers   Genpact,


List types of storage classes in java?

0 Answers   Cyient,


Categories