Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Compose a Computer Class | Composition, Inheritance, and Refactoring
C# OOP Class Construction Drills
セクション 4.  2
single

single

bookChallenge: Compose a Computer Class

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Practice composition by building a Computer class that contains other component classes. In this task, you will implement a Computer class that holds references to CPU, RAM, and Storage objects as its fields.

  • Add fields to the Computer class for CPU, RAM, and Storage.
  • Implement a constructor for Computer that takes CPU, RAM, and Storage objects as parameters and assigns them to the corresponding fields.
  • Add a method GetSpecs() to the Computer class that returns a string combining the results of calling GetInfo() on each component.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 4.  2
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt