-
Finally
Topic 4-2
1.1 Your Submission Results (Advent number)
1.2 4-2 What do I need to be aware of when catching an exception in finally?
-
Improve Arrayintegerstack with exception
Topic 4-3
2.1 Your Submission results (Advent number)
2.2 Experimental Summary
-
Custom exceptions
Topic 5-4
4.1 Your Submission Results (Advent number)
4.2 What are the key points for custom exceptions?
-
Read files and Assemble objects
Topic 3: Reading files and assembling objects in the lab task book
Give the key code (need to show your school number)
-
Learn to debug with Eclipse
Watch related Debug Videos
5.1 Briefly how many steps do I need to debug with eclipse? Answer: ① set breakpoints in the right place
② Start Debug mode
The ③eclipse has a dedicated debug perspective, specifically for commissioning
④ Viewing status values
5.2 Debugging when F5, F6, F7 fast key each have what difference? What is the shortcut key to use? For:
F5-->step into (jump in): function enters and continues stepping
F6-->step over (Skip continue): The function of this command is to step through the code, if the function is encountered skip function, that is, the function as a statement to treat
F7-->step return (jump): When stepping into a child function, you can execute the remainder of the child function with step return and return to the previous layer function.
Summary: Want to single-step debugging into the function of using F5;
Single-step debugging does not go inside the function using F6; you want to return from inside the function to the call by using F7.
5.3 What other methods do you use to debug a program besides the Eclipse debugger?
A: Use the System.out.println Insert PRINT statement in the program, but this method is extremely inefficient.
-
Title Set多线程
6.1 Procedures fill in the blanks 3-1, 3-2. (Submit results, show your school number)
6.2 Function 4-1 (Thread), 4-2 (Runnable) (submit result, your study number appears)
6.3 Function 4-3 (runnable and anonymous inner Class) (Submit results, show your school number), and use LABMDA expression to overwrite.
6.4 Experimental Summary
-
Source code reading: Multi-threaded Bouncethread
7.1 Which class is a multithreaded-enabled class that implements what interface. What does this class do? A: Ballrunnable class, realizes the Runnable interface, this class, moves the ball position, then draws out, realizes the small ball the movement effect.
7.2 Ball.java This program has only done two things, what are the two things respectively? A: Move () gets the position after the ball moves, getshape () generates a small ball.
7.3 Ballcomponent also only did two things, what are the two things respectively? Answer: Add (ball B), paintcomponent ( Graphics g) To draw all the added balls.
7.4 Bouncethread, when did the new thread start? A: When adding a new ball, start a new thread.
7.5 How is this program implemented? What is the approximate execution process? , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp A: Set up a jframe, use components to let the small ball can be displayed, click Start, join the small ball (constantly click Start, continue to join the ball), the program through constantly changing the position of the ball and then draw out to achieve a motion effect, when the ball movement to a specific position, Then stopped.
-
Multithreading in the Shopping cart system
8.1 What are the possible multithreading problems in the shopping cart system? A: Each user is a thread, if more than one user on the number Limited merchandise to buy, there may be a shortage of goods problems, this is a first-come first-served.
3. Code submission record on code Cloud 3.1. Codes Cloud Code submission record