セクション 2. 章 6
single
Challenge: 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.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 2. 章 6
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください