文件名称:public class A
介绍说明--下载内容来自于网络,使用问题请自行百度
创建一个类A,在A中编写一个可以被重写的带int类型参数的方法MyMethod,并在该方法中输出传递的整型值加10后的结果。
再创建一个类B,使其继承自类A,然后重写A中的MyMethod方法,将A中接收的整型值加50,并输出结果。
在Main方法中分别创建类A和类B的对象,并分别调用MyMethod方法(Create a class A, write a MyMethod that can be rewritten with int type parameter in A, and output the passed integer value plus 10 results in this method. Then create a class B to inherit from the class A, and then rewrite the MyMethod method in A, add 50 the integer value received in the A, and output the result. In the Main method, the objects of the class A and the class B are created respectively, and the MyMethod method is called respectively)
再创建一个类B,使其继承自类A,然后重写A中的MyMethod方法,将A中接收的整型值加50,并输出结果。
在Main方法中分别创建类A和类B的对象,并分别调用MyMethod方法(Create a class A, write a MyMethod that can be rewritten with int type parameter in A, and output the passed integer value plus 10 results in this method. Then create a class B to inherit from the class A, and then rewrite the MyMethod method in A, add 50 the integer value received in the A, and output the result. In the Main method, the objects of the class A and the class B are created respectively, and the MyMethod method is called respectively)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
public class A.doc | 20480 | 2017-11-29 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.