If a member of its superclass is declared public, the subclass inherits that member : public « Modifiers « SCJP

Home
SCJP
1.Java Source And Data Type
2.Operators
3.Modifiers
4.Type Casting
5.Statements
6.Object Oriented
7.Thread
8.Utility Classes
9.File
SCJP » Modifiers » public 
3.4.2.If a member of its superclass is declared public, the subclass inherits that member
package cert;
public class MainClass {
  public String doMainClassThings() {
    return "fun";
  }
}

package notcert;   //Not the package MainClass is in
import cert.MainClass;
class Cloo extends MainClass {
  public void testCloo() {
    System.out.println(doMainClassThings());
  }
}
3.4.public
3.4.1.The most generous access modifier is public.
3.4.2.If a member of its superclass is declared public, the subclass inherits that member
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.