- public class OverrideTest extends Test{
- @Override
- public void t(String s){
- System.out.println("OverrideTest.t(String):" + s);
- }
-
-
- public void t2(float f){
- System.out.println("OverrideTest.t2(float):" + f);
- }
- public static void main(String[] args){
- OverrideTest ot = new OverrideTest();
- ot.t("china34420");
- ot.t2(1.0f);
- ot.t2(1);
- ot.t3();
- }
- }
-
- class Test{
- public void t(String s){
- System.out.println("Test.t(String):" + s);
- }
- public void t2(int i){
- System.out.println("Test.t2(int):" + i);
- }
- public void t3(){
- t("override");
- }
- }
posted @
2016-01-23 14:38
苍狼哂啡
阅读(
14857)
评论()
编辑
收藏
举报