Define Abstract method & class with Example
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / micheal b
abstract means wrapping the data in sigle unit
class is a user define data type
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / ramyathillainathan
We can indicate that a method must always be redefined in a sub class , thus making overriding compulsory. This is done using the modifier keyword abstract in the method definition.
example;
abstract class Shape
{
------------
------------
Abstract void draw();
------------
---------------
}
Is This Answer Correct ? | 0 Yes | 0 No |
Tag for turning an image into a hyperlink is
How should a programmer decide whether to use a macro or a subroutine to accomplish a given logical function
1 Answers R V College of Engineering, University of Jordan,
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number
How to convert numeric value into words in c#????plz suggest me the coding of this question???
hi, all this is shoba m.c.a . i have learned abap but no oppurtunities right now as fresher , right now i want to learn any course on demand any one pls suggest me good course and institute in hyderabad
how to invoke the macro in another macro?
What is diffrent between Method and and function in c#
Write a Pseudo Code to fins the LCM of two given numbers
smal talk is pure object oriented or not?
hi all, i need ur help in preparing a sql which performs scd2, i mean i have a scd2 mapping i need a sql which can give me same result as scd2 mapping, SRC table: cust_no, loc 01 abc 02 xyz TGT table: pm_ky cust_no loc current_flag 1 01 abc Y 2 02 xyz Y cust 1 has changed his loc to xyz then it loads into TGT table as below, pm_ky cust_no loc current_flag 1 01 abc N 2 02 xyz Y 3 01 xyz Y i need sql to get the above result, hope got me question, Any suggestion will be appreciate.. thanks, Vinod
how we can call xml file in java file using Android platform?
1.group by clause explain along with an example