- 7
- 0
- 约4.5千字
- 约 5页
- 2023-10-13 发布于广西
- 举报
c#程序设计教程(李春葆第三版)第五章课后程序题答案
exci5-1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace exci5_1
{
class Program
{
static void Main(string[] args)
{
Person p1 = new Person(2, 50);
Animal a1 = new Animal(4,120);
p1.show();
a1.show();
}
}
public class Person //定义⼈类
{
public int legs; //腿的只数
protected float weight; //重量
public Person() //默认构造函数
{ }
public Person(int legs1, float weight1)//⾃定义⽅法F
{
legs = legs1;
weight = weight1;
}
public void show()
{
Console.WriteLine(“
您可能关注的文档
最近下载
- 2026抖音运营全链路实战攻略.pptx VIP
- With的复合结构和独立主格课件.ppt VIP
- 国标规定的标准中的字号和字体[参照].doc VIP
- (正式版)DB51∕T 10006-2023 《 公路边坡网锚喷植被混凝土生态防护技术指南 》.pdf VIP
- 山西省工程系列建设工程风景园林专业高级职称评审考试试题及答案.docx
- 苗族文化PPT课件.pptx VIP
- 2024中国糖尿病临床诊疗与药物多渠道市场数据分析报告.pdf VIP
- 工程勘察设计收费标准(2002年修订本)完整版.pdf
- 碳纤维加固板计算书.xls VIP
- 2018通信光缆和电缆线路工程安装标准图集YDT 5241-2018.docx
原创力文档

文档评论(0)