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

Enlist diffrent types of inheritance supported by java?

863


What is mnemonic in assembly language?

1026


What is not thread safe?

935


What is the use of put method?

908


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

963


Write a program to find the whether a number is an Armstrong number or not?

969


Write a method that will remove given character from the string?

980


do I need to use synchronized on setvalue(int)? : Java thread

970


Why do we need wrapper classes?

1029


What is difference between class and object in java?

1032


What is the class in java?

977


Can a class with private constructor be extended?

900


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1059


Can you give few examples of final classes defined in java api?

967


What is the this keyword?

993