Define Abstract method & class with Example

Answer Posted / manoj kumar verma allahabad(ba

Abstract class shows kins of relationship.it is the impure
abstract.Abstract class can have method with body or
without. Abstract class can not be instantiated.e.g. Object
nahi ban sakta abstract class ka.

for example :-
abstract class Shape
{
abstract void area(); // No body compulsory to be
overriding
void show()
{
System.out.println("Shape is the show");
}
}
class circle extends Shape
{
void area()
{

}
void show()
{
System.out.println("Show the circle");
}
}
class Testabstract
{
public static void main(String ar[])
{
circle c1=new Shape(); // error object of
abstract class cannot be made
circle c2=new circle();
c2.area();
c1.show();
}
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is radio button? Plz show code this! how will select radio buttons to go next window Forms? Supose o radio button1 o radio button2 o radio button3 o radio button4 how will coding this? Plz explain this!

2901


What is the Difference between in memory database and physical database

2078


what is the diff bw sql direct and jdbc update can't we do select and updating operation in sql direct

1682


what is the use of occurs 10 or (any number) in the internal table declaration with header line.

1466


how to fin top two miximum values in sql? not 2nd both max value of 1st and 2nd both have to find out

1489






how do i add a column dynamically in a table by using java application?

1545


can any one suggestion me present which course(except java,.net) has huge demand in the market?

1617


How do you pass variables forwrd to future CECI sessions

4078


I want Ada programming language books. Could anyone post me any link for that?

2948


Find out the list of roles which gives access to GUI activities? thanks in advance

1721


design a counter with the following repeated binary sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8 using JK Flip Flop.

16221


If u need any fake experience certificate in software side, contact me at: vikramyadhav@gmail.com

7839


how to add Servlet-api.jar file into eclipse 3.3.2 ?

4052


1) How can u create the table?

1375


Given: coordinates of rectangle-> left bottom and right top points. the rectangles create a hole.Find the maximum area of the hole. eg. 4 rectangles create a hole in between. find its area.

1976