R4R Java SourceCode Abstract Example

Abstract Example

In this example we are going to create an abstract class, gives the signature of two methods and gives its body into extended class.

SOURCE CODE


abstract class AbstractExp{
	abstract void show();
	abstract void display();
	void show1()
	{
	System.out.println("Concreate Method");
	}
	}
 class Abstractdemo extends AbstractExp{
 	void show()
 	{
 	System.out.println("Hi");
 	}
	void display()
	{
	System.out.println("Hello");
	}
	}
 class Abstract{
 	public static void main(String a[]){
 		Abstractdemo demo=new Abstractdemo();
 		demo.show();
 		demo.display();
}
}

Download Source File

[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]
[an error occurred while processing this directive]