文件名称:1.6
介绍说明--下载内容均来自于网络,请自行研究使用
编写一个控制台应用程序,完成下列功能,并写出运行程序后输出的结果。
1) 创建一个类A,在A中编写一个可以被重写的带int类型参数的方法MyMethod,
并在该方法中输出传递的整型值加10后的结果。
2) 再创建一个类B,使其继承自类A,然后重写A中的MyMethod方法,将A中接
收的整型值加50,并输出结果。
3) 在Main方法中分别创建类A和类B的对象,并分别调用MyMethod方法
-Write a console application, complete the following functions, and write the output after running the program results. 1) create a category A, in A in the preparation of a can be rewritten with int type parameters MyMethod, and in the methods of transmission of the output value of 10 after cosmetic surgery results. 2) re-creation of a category B, so that it inherited from the category A, and then rewrite A in MyMethod method to receive the integer A value of plus 50, and output results. 3), respectively, in the Main method to create category A and category B of the object, and call respectively MyMethod method
1) 创建一个类A,在A中编写一个可以被重写的带int类型参数的方法MyMethod,
并在该方法中输出传递的整型值加10后的结果。
2) 再创建一个类B,使其继承自类A,然后重写A中的MyMethod方法,将A中接
收的整型值加50,并输出结果。
3) 在Main方法中分别创建类A和类B的对象,并分别调用MyMethod方法
-Write a console application, complete the following functions, and write the output after running the program results. 1) create a category A, in A in the preparation of a can be rewritten with int type parameters MyMethod, and in the methods of transmission of the output value of 10 after cosmetic surgery results. 2) re-creation of a category B, so that it inherited from the category A, and then rewrite A in MyMethod method to receive the integer A value of plus 50, and output results. 3), respectively, in the Main method to create category A and category B of the object, and call respectively MyMethod method
相关搜索: 控制台应用程序
(系统自动生成,下载前可以参看下载内容)
下载文件列表
第六题.docx