jQuery in Action
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Professional Certification » Programmer Certification (SCJP)
 
RSS feed
 
New topic
Author

A confirmation required about interfaces...

Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Messages: 295

That is, We can put any access modifiers(public, protected, default, private) to interface? Please confirm? Then what about the non-access modifiers? Only abstract??

SCJP 6 in progress......!!!!!!.
Ankit Garg
Bartender

Joined: Aug 03, 2008
Messages: 6328

Why do you want us to confirm it when you can compile and check it??

SCJP 6.0 98%, SCWCD 5 98%, Javaranch SCJP FAQ, SCWCD Links
Heba Mahmoud
Ranch Hand

Joined: Apr 26, 2009
Messages: 59


only public and abstract modifiers are premeited for interface "top level interface"

but for interfaces that defined in classes what access modifiers is valid for it........ " no restrication " as in the example
as inner classes.

SCJP Pass 85%....
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Messages: 295

Ankit Garg wrote:

Why do you want us to confirm it when you can compile and check it??



Yea, correct.

Thanks a lot Heba Mahmoud for you valuable information...

SCJP 6 in progress......!!!!!!.
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Messages: 295

What about default modifier for the interfaces? Because, It's said in the K&B's book, that.....

........


The public modifier is required if you want the interface to have public rather than default access......


Here the keyword abstract is redundant, But what about public, Is every interfaces are implicitly public?? No?? There are default interfaces?? Somebody confirm? Thanks in Advanced!

SCJP 6 in progress......!!!!!!.
Ankit Garg
Bartender

Joined: Aug 03, 2008
Messages: 6328

Abimaran Kugathasan wrote:Is every interfaces are implicitly public?? No?? There are default interfaces?? Somebody confirm?

Again you can create an interface in one package and don't make it public and try to access it in a different package and you'll get your answer...

SCJP 6.0 98%, SCWCD 5 98%, Javaranch SCJP FAQ, SCWCD Links
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Professional Certification » Programmer Certification (SCJP)
 
RSS feed
 
New topic
TrainBeaser for iPhone