File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Ambiguous use of abstract?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Ambiguous use of abstract??" Watch "Ambiguous use of abstract??" New topic

Ambiguous use of abstract??

Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
This compiles, as the member class can have modifiers just like
any other member of class Z.
But dosen't this contradict the notion that a class that contains
abstract members must itself be abstract?
class Z {
abstract class A {} // 1
final class B {} // 2
private class C {} // 3
protected class D {} // 4
public class E {} // 5

"....bigmouth strikes again, and I've got no right to take my place with the human race...."<p>SCJP 1.4
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Only a class that contains not implemented abstract methods, directly or through inheritance, must be declared abstract. Member classes or interfaces don't count. abstract Classes
An abstract class is a class that is incomplete, or to be considered incomplete. Only abstract classes may have abstract methods (�, �9.4), that is, methods that are declared but not yet implemented. If a class that is not abstract contains an abstract method, then a compile-time error occurs.
Sandhya Jayaram

Joined: Dec 16, 2003
Posts: 16
is it that only a class having abstract methods has to be abstract itself. but if that abstract class is an inner class then the outer class need not be abstract?
hope i framed the question correctly
I agree. Here's the link:
subject: Ambiguous use of abstract??
jQuery in Action, 3rd edition