From the course: Java 11+ Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Handle exceptions with try/catch - Java Tutorial
From the course: Java 11+ Essential Training
Handle exceptions with try/catch
- [Instructor] There are two broad categories of errors you can encounter in Java programming. First of all, there are syntax errors. These are coding errors that you have to fix before you can even compile your application. Let's take a look at this simple comment. It starts with two slashes. If I were to forget to put in the second slash, I would have a syntax error. The Java compiler won't recognize that. It doesn't know what write your code here means. And when I try to run it, I'll get a complication errors shown here in the build window. I'll just get rid of that bit of code completely, I'm not interested in it. And instead, I'll show you a more common sort of problem. Let's say I'm trying to create a string. And I want to assign it initially to a value of null. If I don't put in my semicolon, that's a syntax error. And again, I can't even compile the application. Those are the most obvious kinds of errors that…