Today i am going to describe about abstract and concrete class.
Concrete class: The class for which object is required are known as concrete classes like JTextfield,JComboBox etc.
Abstract Class: The classes for which it is not essential to declare objects to use them are know as abstract classes like JOptionPane
Abstract classes are normally used as a base class in inheritance for which no direct object required to created.Also abstract class are used for defining generic methods where there is no requirement of storing result.
A abstract class contains at least one abstract method.
The super class set up as an abstract class does not allow objects of its prototypes to be created. In this case only object of the subclass are used.
Remembering Point: Notic that the JOptionPane Class which is an abstract class has no data members an so it will not be able to store any values.The reseason behind is that because we cannot create objects of an abstract class ,so we will not able to provide any data to this class. Therefore ,there is no point of having a data member.
Example:
public abstract class shape
{
...
...
...
}

Comments
Post a Comment