Abstract class in Java
Abstract class in Java
Abstract class in Java as the interface, but may contain the default
execution method. The abstract class can have abstract methods without the body
and can have methods with the application.
Classes are declared as abstract, known as abstract classes. It
can have abstract and non-abstract methods.
·
Abstract classes must be
declared and the keyword is abstract.
·
They may have abstract and
non-abstract methods.
·
should not encourage.
·
They can have a static and
solid builder as well.
·
They may have work that will
force the subclass method not to change the body.
package Mypkg;
public class myabs {
/**
* @param args
*/
public static void main(String[]
args) {
// TODO Auto-generated method stub
System.out.println("Entered myabs-Main() ");
System.out.println("***************************************");
useabs ob=new useabs();
ob.getDisplay();
ob.getD();
System.out.println("***************************************");
System.out.println("Exited myabs-Main() ");
}
}
abstract class myabsEx
{
abstract void getDisplay(); //
Abstract method
void getD() // other method
{
System.out.println("This is normal method inside Abstract
class");
}
}
class useabs extends myabsEx
{ void getDisplay()
{
System.out.println("This is re Definition given of
Abstarct method class");
}
}
Output :
Entered myabs-Main()
***************************************
This is re Definition given of Abstarct method class
This is normal method inside Abstract class
***************************************
Exited myabs-Main()
.I simply wanted to thank you so much again. I am not sure the things that I might have gone through without the type of hints revealed by you regarding that situation.
ReplyDeleteoracle training in chennai
oracle training in velachery
oracle dba training in chennai
oracle dba training in velachery
ccna training in chennai
ccna training in velachery
seo training in chennai
seo training in velachery