Kathryn shows you how to debug a Java program using breakpoints in IntelliJ IDEA. Breakpoints allow you to intentionally pause a program’s execution to get more information.
- [Instructor] In the last video,…we created a coin flipping program…and debugged it with print statements.…We'll be using the same program in this video…to see how we can debug it with an IDE.…Taking a look at the code before,…here we have our coin class.…We have our heads and tails final static int variables.…We have our private int faceUp…that says what side of the coin is faceUp.…Is it heads or is it tails?…We have our constructor where we flip the coin…for the first time.…We have our flip method…which basically chooses a random number…that's either zero or one.…
And then we have our getFaceUp method here on line 19…and this basically gives a string output to the user…so they don't have to deal with these ones and zeroes.…Going back to our main class, we created this Coin c.…It's an instance of our coin class.…And then we printed out the initial faceUp of that coin.…And then we went ahead and went into a for loop…and flipped it 10 times.…And after each flip, we saw what the faceUp value was.…Is it heads, tails, or something invalid?…
- Downloading Java 9 and choosing an IDE
- Understanding Java basics: data types, strings, arrays, and more
- Controlling flow with functions and loops
- Working with inheritance and interfaces
- Learning lambda
Skill Level Beginner
1. Getting Started
2. Java Basics
3. Control Flow
4. Beyond the 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.