计算机二级java辅导:构造方法的继承计算机等级考试

文章作者 100test 发表时间 2010:01:01 12:26:00
来源 100Test.Com百考试题网


  构造方法是一种特殊的方法,它的继承规则比较简单,而且与普通方法有较大的区别

  1 无参数构造方法的构造方法示例

  class hasConstructor{

  protected int x=100.

  public void showMsg(){

  System.out.println("this is a method in ancesstor").

  }

  public hasConstructor(){

  System.out.println("this is a constructor in ancestor without parameter").

  }

  public hasConstructor(int ix){

  System.out.println("this is a constructor in ancestor with parameter").

  }

  }


相关文章


诊断Java代码:SplitCleaner错误模式计算机等级考试
Java常用类型定义、转换及比较计算机等级考试
javastatic变量的介绍计算机等级考试
实例讲解main()中方法调用的问题计算机等级考试
计算机二级java辅导:构造方法的继承计算机等级考试
Java网络编程概述计算机等级考试
JavaBean与反射的学习小记计算机等级考试
java中super的两种用法计算机等级考试
JAVA编码转换的详细过程计算机等级考试
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛