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 |
Diff.b/w Frames and container?
1 Answers Tech Mahindra, Wipro,
How to convert numeric value into words in c#????plz suggest me the coding of this question???
which worker is involved in all the phases of SDLC?
SYNFOSYS PLACEMENT PAPER 2010 Hi Friends I have attended the recent synfosys test 2010. Here r some questions which i remember. Section – I 1) There are 12 balls weigh similar but one is dissimilar (more/less). How to find the dissimilar ball with minimum no of weighs? 2) There r 7people carrying 7bags. Each bag contains 7cats. Each cat has 7small cats. How many total legs r there? 3) There are 12 balls weigh similar but one is dissimilar (more/less). How to find the dissimilar ball with minimum no of weighs? 4) 5) There r 2 poles each 15 meters high. A cable of length 16 meters is tied between pillars top. For its maximum the cable lies down above 7mts high from the ground. What is the distance between pillars? ------------------------------------------------------------ ------------------------------------------------ Section -II What is the value of 11^5 Some Other quetions ------------------------------------------------------------ ------------------------------------------------ Section - III 16) Serialization and deserialization? 17) Will finally block execute even though there is an exception & return statement are there in catch block? Explain? 18) memory leak? How can we avoid it? 19) virtual destructor? 20) Two program codes for code optimization? ------------------------------------------------------------ ------------------------------------------------ Section – IV Q) Program for finding the alternate digits of the number If number is 35846 then Sum1=3+8+6=17 Sum2=5+4=9 Q) Program for Single linked list? ------------------------------------------------------------ ------------------------------------------------ Section - V Q) What is software engineering? Explain SDLC Q) Explain any two upcoming IT Scenarios? ------------------------------------------------------------ ------------------------------------------------ Regards Gopinath Allanku +91 9885457211
Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren?t present.
can we extend a class having only one parameterised constructor.Suggest the process to do it.
There are 3 jars containing two types of round marbles. One jar contains only red marbles, one jar contains only blue marbles and the third jar contains a mix of both red and blue marbles. Although the jars are labeled “red”, “blue” and “mixed” – all the jars are mislabeled. How many marbles would you have to pull out, and out of which jars, to find out how to fix the labels correctly?
£¢®£ž›;=9:B9<::C = ADITHI HOW TO GET?
plz send me NIC Scientific Officer /Engineer-SB(Programmer) previous question paper or syllabus
what is the system development cycle
hai i am prasanna.I am MCA 2009 fresher.tell me about certifications.which certification helps me to improve my carrier and to get a technically oriented job ,which certification helps to get job faster.
What r the attributes using in Win Runner?
0 Answers Tavant Technologies,