View Single Post
  #4 (permalink)  
Old 01-24-2008, 06:09 AM
gibsonrocker800's Avatar
gibsonrocker800 gibsonrocker800 is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
Oh, and for informational purposes, there is one more of these access-specifiers: "package". This obviously means that only classes that are within the same package of the class can use it. Ex:
Code:
package pack; public class Example { //Constructor package int getSum() { //code } }
If we were to have a class:
Code:
package pack; public class ExampleTester { public static void main(String[] args) { Example e = new Example(); int sum = e.findSum(); //OK, this class is in the same package as Example } }
}
__________________
//Haha javac, can't see me now, can ya?
Reply With Quote