tft每日頭條

 > 科技

 > csharp學習攻略

csharp學習攻略

科技 更新时间:2025-08-19 06:00:24

  06面向對象練習

  using System;

  using System.Collections.Generic;

  using System.Linq;

  using System.Text;

  using System.Threading.Tasks;

  namespace _06面向對象練習

  {

  class Program

  {

  static void Main(string[] args)

  {

  //作業:定義父親類Father(姓lastName,财産property,血型bloodType),

  //兒子Son類(玩遊戲PlayGame方法),女兒Daughter類(跳舞Dance方法),

  //調用父類構造函數(:base())給子類字段賦值

  //Son son = new Son("張三",10m,"AB");

  //son.PlayGame();

  //son.SayHello();

  //Daughter d = new Daughter("張梅梅", 100m, "O");

  //d.SayHello();

  //d.Dance();

  //Console.ReadKey();

  //作業:定義汽車類Vehicle屬性(brand(品牌),color(顔色))方法run,

  csharp學習攻略(電腦絕技教你22天學精Csharp之第二十天基礎加強總複習)(1)

  csharp學習攻略(電腦絕技教你22天學精Csharp之第二十天基礎加強總複習)(2)

  ,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关科技资讯推荐

热门科技资讯推荐

网友关注

Copyright 2023-2025 - www.tftnews.com All Rights Reserved