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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are void pointers?

1317


Why do we need singleton?

975


Convert a BST into a DLL and DLL to BST in place.

1116


What is the purpose of a parameter?

1080


What is string [] java?

959


What is meant by attribute?

1133


Can we use catch statement for checked exceptions?

972


What are java packages? What's the significance of packages?

1334


How many java versions are there?

1060


What is linked hashset and its features?

1067


What is the difference between replace and replace all?

1031


What is a instance variable?

1068


What is the difference between an object-oriented programming language and object-based programming language?

1020


Do loops java?

1028


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

1092