

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Notes; Professor: Hanks; Class: Intro to Programming in Java; Subject: Computer Science Info Systems; University: Fort Lewis College; Term: Unknown 1989;
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!
Quiz Results mean 20. stdev 5 median 22 max 24 Distribution (after EC): <15: 1 15-17: 2 17.5 – 19.5: 3 20 – 22: 1 22.5+: 5 Reading Assignment: Section 4.11. Potentially confusing. Read before Monday, and again after lecture. Last time: this keyword Debugger Open the mail project again. Create a server and two mail clients: One for Fred and one for Bill. Send message from Fred to Bill, but don’t read it yet. I’m going to be using a tool called a Debugger so we can see what is happens when Bill tries to print his next email. Set BP on first line of printNextMailItem. Then call this method for Bill. What happens? A new window comes up – this is the debugger window. It has some parts:
What will happen if I press the step button again? Press step a couple more times. Then press continue button – program will run until it gets to a breakpoint. Stepping into a method Set up message again, and get to the breakpoint. Use step once. Point out how the step function treats the method call as an abstraction – it treats it as a unit. What if we want to see what the method does? Press the step button to get to the item.print() statement. Then press ‘step into’. Object creation We’ve used the debugger to look at what happens when we try to print a message. What happens when we send one. Clear breakpoint, and set new one on first line of SendMessage method. Step into the constructor – this allows us to see in more detail how this works. Summary We’ve used a debugger to allow us to investigate a program while it is running. This helped us understand how the program worked – we can also use this tool to help us find problems in our code. This project used many of the same ideas as the clock-display: