Define Abstract method & class with Example

Answers were Sorted based on User's Feedback



Define Abstract method & class with Example..

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

Define Abstract method & class with Example..

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

Define Abstract method & class with Example..

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

Post New Answer

More Programming Languages AllOther Interview Questions

what is the purpose of checked Menu options

0 Answers  


Write a Pseudo Code to fins the LCM of two given numbers

5 Answers   Goldman Sachs,


Write a program to find duplicate number from array in minimum time complexity.

0 Answers   Genpact,


What are the Short cut Keys of Tally ERP?

0 Answers  


how do i create my own exception class which will restrict IO exception?

0 Answers  






how to run servlets in eclipse 3.3.2....if we choose file->new->servlet then after that it is showing javax.servlet.* ...cannot be resolved.......to avoid this error any external jar file is to be added? please help me regarding this issue........thank u

2 Answers   IBM,


how many types of bytes are there???

0 Answers  


what is the difference between set and append?

3 Answers   ICICI,


What is SAP TAO? · Which Version you are using? · What is the Latest Version in SAP TAO? · What are the Advantages in SAP TAO? · What are the Patches required for SAP TAO? · What is BPT? · Difference between BPT & SAP TAO? · Which Framework using for SAP TAO? · What is CBASE? · What is the SAP TAO Architecture? · What are the Prerequisites for SAP TAO? · SAP Solution Manager Mandatory for SAP TAO 1.0? · SAP Solution Manager Mandatory for SAP TAO 2.X? · What is UI Scanner? · What is Inspector? · How many ways to Create a components using TAO 1.0? · How many ways to Create a components using TAO 2.x? · Which service pack required for SAP TAO 2.7? · What is Import/Export? · What is Consolidate?

0 Answers   Cognizant,


I m Abdullah Ansari compleated MCA from Jamia Hamdard,i have appeared the test of IBM on 2 august at oxford college of engineering Bangalore.waiting for hr round.. This is the first round for IBM.02/08/08 Paper consists of 4 sections 15 questions from matrices(time very less but no negative marking). 25 questions from series completion section (this section is very easy but negative marking) 15 questions from aptitude(little bit tough time limit 15 minute negative marking) 4th section is from computer science (c,c++,operating system,digital electronics ,basic question..) result came at 3 o'clock.i was selected... In interview they asked questions like 1 they asked about final yr project.. 2 what are dynamic and static memory location? 3 linked list and array difference between them. 4 what is function ? what is difference betwen function and inline function? 5 about structure 6 about binary tree, traversal, call by value. 7 storage class and many more basic questions..

0 Answers   IBM,


how can we maintain the previous version scripts to new version.

0 Answers   DST Global Solutions,


along with oracle which language will be beneficial to have knowledge with,java,.net,since i m doing oracle have appeared for 8th sem BEIT,plz suggest

0 Answers  


Categories