Monday, July 21, 2008

Which of the following statements it true about the following code:

public abstract final void goAndGetCertified() {}


The code will successfully compile and run.

The code will compile but not run.
A final method cannot be void, so the code will not compile.
A final method cannot be abstract, so the code will not compile.
A final method cannot be public, so the code will not compile.
A final method cannot be abstract, so the code will not compile.

############################

Which of the following statements it true about the following code:

public abstract void goAndGetCertified() {}

The code will successfully compile and run.

The code will compile but not run.
An abstract method cannot be void, so the code will not compile.
An abstract method cannot be public, so the code will not compile.
An abstract method cannot have a name, so the code will not compile.
An abstract method cannot have an implementation, so the code will not compile.

No comments: