• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

access specifier

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can classes have access specifier other than 'public' and 'no specifier - friendly' specifiers
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep and No...
A top level class/interface has to be public.
if u try to compile a top level class with access modifier as default or say protected it gives error..
But if a class is not top level class then it can be protected/default....
Hope I am right.
But abt top level thing I am sure that it has to be public..Cannot be any other thing..

Originally posted by Sagar Sharma:
can classes have access specifier other than 'public' and 'no specifier - friendly' specifiers


 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Top level class could be abstract,final,public
or none(i.e. package or default specifier)
regds
Nm
------------------
"Knowledge is Power"****************MY SCJP RESOURCES
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
just to add ---
non top level class can be private also.

regards
deekasha

[This message has been edited by deekasha gunwant (edited January 15, 2001).]
 
No holds barred. And no bars holed. Except this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic