1 /* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 public class Derived extends Base { notDeclaredInBase()18 public static void notDeclaredInBase() { 19 System.out.println("notDeclaredInBase: Derived"); 20 } 21 overridden()22 public void overridden() { 23 System.out.println("overridden: Derived"); 24 } 25 wasOverridden()26 public void wasOverridden() { 27 System.out.println("wasOverridden: Derived"); 28 } 29 overrideWithPublic()30 public void overrideWithPublic() { 31 System.out.println("overrideWithPublic: Derived"); 32 } 33 overridePublicWithProtected()34 protected void overridePublicWithProtected() { 35 System.out.println("overridePublicWithProtected: Derived"); 36 } 37 overrideProtectedWithPublic()38 public void overrideProtectedWithPublic() { 39 System.out.println("overrideProtectedWithPublic: Derived"); 40 } 41 overridePublicWithPrivate()42 private void overridePublicWithPrivate() { 43 System.out.println("overridePublicWithPrivate: Derived"); 44 } 45 overridePrivateWithPublic()46 public void overridePrivateWithPublic() { 47 System.out.println("overridePrivateWithPublic: Derived"); 48 } 49 50 /* not really an "override"; just has same method signature */ overrideVirtualWithStatic()51 public static void overrideVirtualWithStatic() { 52 System.out.println("overrideVirtualWithStatic: Derived"); 53 } 54 55 /* not really an "override"; just has same method signature */ overrideStaticWithVirtual()56 public void overrideStaticWithVirtual() { 57 System.out.println("overrideStaticWithVirtual: Derived"); 58 } 59 } 60