aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes protected class-compile error 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 "protected class-compile error" Watch "protected class-compile error" New topic
Author

protected class-compile error

Raja Narasimha
Ranch Hand

Joined: Nov 28, 2010
Posts: 33
Hi, Why I am getting compile error
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18847
    
  40

Similar to your other topic....

http://www.coderanch.com/t/518655/java-programmer-SCJP/certification/enum-cannot-private-or-protected


Top level protected classes are not allowed.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Isac paul
Greenhorn

Joined: Dec 06, 2007
Posts: 6
First of all, The access modifiers protected and private are not applicable for Class.
So, Why you want to create class which is having protected access ???
What is the purpose of writing a class ???

Please read more on access modifiers and non-access modifiers.

You can protect only your members ( Instance Variables or methods ) by using protected keyword ..


Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 440

Isac paul wrote:First of all, The access modifiers protected and private are not applicable for Class.



actually I want to correct this a little bit
we can write a protected INNER class but NOT the outer class

outer class can be only public and default

have a nice time

SCJP 6 [86%] June 30th, 2010
OCPWCD [84%] March 26th, 2012
OCEJPAD [83%] September 6th, 2014
If you find any post useful, click the "plus one" sign on the right
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: protected class-compile error