aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Ambiguous use of abstract??" Watch "Ambiguous use of abstract??" New topic
Author

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.

8.1.1.1 abstract Classes
An abstract class is a class that is incomplete, or to be considered incomplete. Only abstract classes may have abstract methods (�8.4.3.1, �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
Greenhorn

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
-sandhya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ambiguous use of abstract??
 
Similar Threads
abstract class
instance initialization blocks doubt
Class Design - define methods that all subclasses have in common.
abstract inner class??
which is valid statement in this question