201521123087 Java programming 10th Week of study summary

Source: Internet
Author: User

1. Summary of this week's study

2. Written work

This PTA work problem set 异常 ,多线程

  1. 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?

  2. Improve Arrayintegerstack with exception
    Topic 4-3
    2.1 Your Submission results (Advent number)
    2.2 Experimental Summary

  3. Custom exceptions
    Topic 5-4
    4.1 Your Submission Results (Advent number)
    4.2 What are the key points for custom exceptions?

  4. 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)

  5. 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.

  6. 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

  7. 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.

  8. 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

201521123087 Java programming 10th Week of study summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.