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


Can an abstract class be final?

Answers were Sorted based on User's Feedback



Can an abstract class be final?..

Answer / ranganathkini

No a class cannot be marked "abstract" as well as "final".
Marking a class "abstract" means it contains partial
implementation of methods and hence depends on its
subclasses to provide concrete implementation.

Marking the class "final" means that no other class can
extend it and hence abstract classes cannot be marked final.

Is This Answer Correct ?    173 Yes 15 No

Can an abstract class be final?..

Answer / sekhar

No We can't do that.Because abstract means We compulsory
subclass it.Once we declare a final we can't sub class
that so that we can't do that.

Is This Answer Correct ?    64 Yes 12 No

Can an abstract class be final?..

Answer / ravikiran(aptech mumbai)

no because the purpose of using both are opposite to each
other,An abtract class must have to get instantiated to
become concrete,where as final class should nn't get subclassed

Is This Answer Correct ?    31 Yes 6 No

Can an abstract class be final?..

Answer / raghav

An abstract class is of no use if it cannot be sub classed
because instances of an abstract class cannot be created.
Moreover a class declaration with abstract and final will
not compile at all and when ever a class is marked final,the
properties cannot be extended

Is This Answer Correct ?    21 Yes 5 No

Can an abstract class be final?..

Answer / sudhakar goud

we can't write why because abstract class says it should be
overridden in subclass but where as final class says it
can't be overridden

Is This Answer Correct ?    13 Yes 2 No

Can an abstract class be final?..

Answer / chandan kumar

No

Is This Answer Correct ?    16 Yes 7 No

Can an abstract class be final?..

Answer / huang

http://java.sun.com/javase/6/docs/jre/api/javaws/jnlp/index.html

The documentation says that
"This class is abstract and final and cannot be instantiated."
for ServiceManager class.

Anyways, the class is not marked as abstract.

Is This Answer Correct ?    15 Yes 6 No

Can an abstract class be final?..

Answer / sudhakar goud

Ans: we can't write both final and abstract
because the abstract say's taht it has to be overridden
where as final say's that it can't be overridden.
That is the reason we can't write both final and abstract

Is This Answer Correct ?    12 Yes 4 No

Can an abstract class be final?..

Answer / yuvaraj

No.Because abstract means We compulsory
subclass it.Once we declare a final we can't sub class
that so that we can't do that.

Is This Answer Correct ?    7 Yes 5 No

Can an abstract class be final?..

Answer / artavazd amirkhanyan

It's good question because of most of people can't explain why we can't have abstract final classes in Java. Most of them says "An abstract class is of no use if it cannot be extended or instantiated". Imagine class where we have 10 static methods and we want them to be final to never be overridden. Now, because of class have only static methods,we can make it abstract and because of restriction on overriding, we can make it final. So abstract final classes can be very useful in aforementioned cases. But we can't have abstract final classes in Java just stupidly because of Java do not let us. And this is one of many silly restrictions of Java.

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is a double?

0 Answers  


Why const and goto are reserved keyword in java?

1 Answers  


What is deadlock and how to avoid this?

2 Answers  


interface X{ void m1(); void m2(); } class Child2 extends Object implements X { public void m1(){ System.out.println("Child2 M1"); } public void m2(){ System.out.println("Child2 M2"); } } public class ParentChildInfterfaceDemo { public static void main(String[] args){ X x = new Child2(); X x1 = new Child2(); x.m1(); x.m2(); x.equals(x1); } } Will the above code work? If yes? Can you please explain why the code x.equals(x1) will work as the equals method is called on interface reference vaiable?

2 Answers  


What does the three dot emoji mean?

0 Answers  


What is the abstraction?

0 Answers  


can we create instance for interface in java?

4 Answers  


What is operator?

3 Answers  


java can provide security ,how can provide?

8 Answers   Aspire, BNP Paribas, Genpact, IBM,


Why java Don't Support Multiple interitence

8 Answers   ABC, Exilant, IBM,


What is string in java is it a data type?

0 Answers  


Does treeset use compareto?

0 Answers  


Categories