00:02
Okay, this question wants us to determine how to read in data from a file using a try and catch statement.
00:11
So that's for error handling.
00:14
So it says we're going to have a try statement with some code.
00:18
And then if that fails, we're going to have a catch clause with some exception in there and some more code for the error.
00:30
So as we can see here, i define just this string to be the file path.
00:36
To this text file in the same directory as my program.
00:42
And it just has some basic text in here.
00:48
And if everything goes well when reading this file, we're going to define a string that holds the text from the file.
01:05
So we're going to do file.
01:06
So we're going to do file.
01:07
Read all text and then put the file path in there.
01:12
And then just to show that that actually does something, let's bring out to the console when we're done...