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

What is difference between abstract class & final class

Answer Posted / farhad

A final class CANNOT be extended or subclassed however it can be instantiated:
final class A{
}

class B{
A a = new A(); //<<< instantiating final class A
We cannot say:
class B extends A //!!! that's a NO NO.
On the other hand abstract class can be subclassed but CANNOT be instantiated.
abstract class A{
}
class B extends A{
}

Is This Answer Correct ?    9 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List down the methods and interfaces of collection class in java.

932


Why are functions called methods in java?

941


How many types of design patterns are there?

1043


Why is a string immutable?

936


What is static import?

1090


What means public static?

991


How does list work in java?

863


What is difference between arraylist and list in java?

1018


What is a class variable?

978


Do you need to import math in java?

934


What are scriptlets?

1025


What is the difference between scrollbar and scrollpane?

1044


What is the purpose of a transient variable?

999


Distinguish between a predicate and a function?

938


What is java util collection?

996