Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Guard Clauses with Custom Exceptions | Custom Exceptions and Guard Clauses
C# Exceptions and Error Handling Practice
セクション 2.  6
single

single

bookChallenge: Guard Clauses with Custom Exceptions

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

タスク

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

Implement a method for a product ordering system that enforces stock limits using guard clauses and a custom exception.

  • If the requested quantity is greater than the available stock, the method must throw an OutOfStockException.
  • If the requested quantity is within the available stock, the stock must be reduced by the ordered quantity.

解答

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

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

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

セクション 2.  6
single

single

AIに質問する

expand

AIに質問する

ChatGPT

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

some-alt