セクション 3. 章 6
single
Challenge: Static vs Instance Demo
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Write the complete Vehicle class from scratch, including all required fields, the static member, and the constructor.
- Define a public static field
TotalVehiclesto track the total number of vehicles created. - Define two public instance fields:
MakeandModel. - Implement a constructor that takes two parameters:
makeandmodel. - In the constructor, assign the
makeparameter to theMakefield and themodelparameter to theModelfield. - Each time the constructor is called, increment the
TotalVehiclesstatic field by one.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 3. 章 6
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください