CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - mymethod
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
GUI Develop
Windows Kernel
WinSock-NDIS
Driver Develop
ADO-ODBC
GDI-Bitmap
CSharp
.net
Multimedia Develop
Communication
Shell api
ActiveX/DCOM/ATL
IME Develop
ISAPI-IE
Hook api
Screen saver
DirextX
Process-Thread
Console
File Operate
Printing program
Multi Monitor
DNA
Other
Search - mymethod - List
[
CSharp
]
1.6
DL : 0
编写一个控制台应用程序,完成下列功能,并写出运行程序后输出的结果。 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
Date
: 2026-01-08
Size
: 10kb
User
:
钱
[
CSharp
]
public class A
DL : 0
创建一个类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)
Date
: 2026-01-08
Size
: 2kb
User
:
kk大人
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.