Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Very simple question, cant remember answer...

 
SAFROLE YUTANI
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you define a member of a class like this...
String s;
...what type of scope does the member assume? Private, public, or protected?
SAF
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it assumes public scope to the class and inner classes.
------------------
Happy Coding,
Gregg Bolinger
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Package scope, right?
 
Colin Kenworthy
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it has package scope: http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
Package is the default if you do not specify an access modifier.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic