Aptitude (12) ASP.NET (2) Automata (4) Browser (1) C (5) C# (1) C++ (10) Code (3) CSS (1) Data Structure (1) DATABASE (3) HTML (1) java (43) JSP (1) math (1) MySql (8) other (6) php (3) Servlet (3)

Saturday, 28 January 2012

Types of classes


If we can create an object(instance)  of a class then that class is called instantiated.
Inherited  mean we  get all the functionality (all of attributes, properties, and methods) of that class which is inherited to new class.
In java there are three types of classes----
1.concrete class:A class that can be instantiated and also can be inherited is called as concrete class.
All class are by default concrete.
2.Abstract class: A class that can never be instantiated and  can be inherited is called as abstract  class.
Such  classes must have abstract  keyword  associated with them.

3.Final class: A class that can be instantiated and can never be inherited is called as final class.
Use final keyword to make such a class.





No comments:

Post a Comment