Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Debugging a Broken Program | Safe File Operations and Debugging
C# Exceptions and Error Handling Practice
セクション 4.  4
single

single

bookChallenge: Debugging a Broken Program

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

タスク

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

You are given a program that attempts to read the contents of a file and print them to the console. However, if the file does not exist, the program throws an exception and crashes. Your task is to fix the program so that it handles the missing file gracefully and no longer crashes when the file is absent.

  • Return "File does not exist." if the file at the given path is missing.
  • Otherwise, return the contents of the file.

解答

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

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

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

セクション 4.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

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

some-alt