• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

package scope

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>>>A file can only contain one outer public class. If you attempt to create a file with more than one public class the compiler will complain with a specific error. A file can contain multiple non public classes, but bear in mind that this will produce separate .class output files for each class



I was reading above lines from link
http://www.jchq.net/certkey/0401certkey.htm

did not understand it.If you have more than one class in a file say A, B, C, D classes out of which D is public and rest 3 ie A, B, C without any access modifier. Is that is legal. What it means about A, B, C classes as they have default scope now. Who all can see A, B, C
 
Marshal
Posts: 77173
370
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java™ Language Specification section about access. Look up default access, which many people call package-private
 
reply
    Bookmark Topic Watch Topic
  • New Topic