Join Peggy Fisher for an in-depth discussion in this video Debugging logic and syntax errors, part of Up and Running with Java.
- View Offline
- Exercise Files
- In programming, there are two main types of errors…that we will review, syntax errors and logic errors.…A syntax error occurs when we make a mistake in our coding,…such as forgetting a semicolon…to indicate the end of a statement.…A logic error is harder to find.…This occurs when we have all the correct syntax…but we coded a portion of the program with an error,…such as maybe, divide by zero.…This program has several syntax and logic errors.…Let's fix them.…As you can see on line 22, there's a red underscore.…
If I put my mouse over the exclamation point…in the left-hand column, it says it's expecting a semicolon.…These are good hints.…I see, I forgot the semicolon here.…Once I put that in there, the red line will go away.…The next error, let's go ahead and see what that is.…When I mouse over it, it gives me a message.…It says incompatible types possible lossy conversion…from double to int.…We mentioned this when we talked about data conversions…using implicit and explicit conversion.…
I cannot do a narrowing conversion where my value…
- Downloading and exploring NetBeans
- Understanding Java basics: data types, strings, arrays, and more
- Controlling flow with functions and loops
- Creating classes
- Sorting and searching arrays
- Manipulating files
- Handling errors
- Building GUIs
Skill Level Beginner
1. Getting Started
2. Java Basics
3. Flow of Control
4. Classes and Objects
5. Beyond the Basics
6. File Manipulation
7. Graphical User Interface Basics
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.