Welcome Guest | Sign in | Register
Abstract - Discussion Page For Q.2484 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Abstract > Questions and Answers

Q: Which of the following is correct (valid) declaration of a class?
A. public abstract class Car{
Protected void acc();
}
B. public interface class Car{
Protected abstract void acc ( );
}
C. public abstract class Car{
Protected abstract void acc ( );
}
D. public abstract class Car{
Protected abstract void acc (){
}
}

Answer and Explanation

Answer:public abstract class Car{
Protected abstract void acc ( );
}

Explanation:
In the first option a) method is not abstract so it should have implementation but in the example it is not there.

In the second option b) method is protected, actually interface methods are public abstract by default so it is not the Answer.

In the fourth one method is abstract but still it is implemented, so that is not the Answer.

So finally c) is the Answer.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.