Which of the following below is FALSE for abstract class?

Options
- An abstract class can have only abstract methods
- An abstract class can have both abstract and concrete methods
- An abstract class is to be extended by another class
- A class can extend only one abstract class


CORRECT ANSWER : An abstract class can have only abstract methods

Discussion Board
abstract class

Abstract class can have both abstract and concrete methods is true

right ans is option A
option A is false


prathamesh patil 08-22-2015 01:40 AM

A)

abstract class can have both concrete and abstract methods


sailu 02-16-2015 12:17 PM

About Abstract class

i think option (A) false know Abstract class can have completed concrete class also know

sudarshan 12-10-2014 11:45 PM

Abstract Class and methods

An abstract class can have only the abstract methods not the concrete methods as this class is declared as such that it may include or may not include abstract methods. Abstract classes can't be instantiated but they can be used using the subclasses. Abstract methods are usually declared without an implementation or without having the braces but having the semicolon like the example below:

abstract void moveTo(double A, double B);

A class declared abstract can only have abstract methods or vice versa. For example:

public abstract class GraphicObject {
// declare fields
// declare nonabstract methods
abstract void draw();
}
When an abstract class is used using subclasses then it provides the implementations for all the abstract methods in its parent class.

Rohit Sharma 08-6-2014 05:47 PM

Correct Solution

In my opinion,
Correct answer should be: An abstract class can have only abstract methods


abstract class GraphicObject {
int x, y;
...
void moveTo(int newX, int newY) {
...
}
abstract void draw();
abstract void resize();
}




kshitiz Dublish 07-21-2014 08:20 AM

solution

Correct ans : An abstract class can have both abstract and concrete method

Source:http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html
An abstract class is a class that is declared abstract—it may or may not include abstract methods.

Piush 07-2-2014 03:54 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement