Based on above representation of methods the classes are devided into two types
1) Normal classes
2) Abstract classes
Normal classes:-
Normal class is a java class it contains only normal methods.
Abstract class :
Abstract class is a jav class which contains at least one abstract method.
To specify the particular class is abstract and particular method is abstract method to the compiler use abstract modifier.
For the abstract classes it is not possible to create an object. Because it contains the unimplemented methods.
For any class if we don’t want instantiation then we have to declare that class as abstract i.e., for abstract classes instantiation (creation of object) is not possible.
Normal class:
class Test
{
void m1()
{
body;
}
void m2()
{
body;
}
void m3()
{
body
}
}
Abstract class:
Abstract class Test
{
void m1() { body; }
void m2() { body; }
Abstract void m3();
}
Abstract class:-
class Test
{
Abstract void m1();
Abstract void m2();
Abstract void m3();
}