The fifth week of Java Programming Study summary 20165218 2017-2018-2

Source: Internet
Author: User

The fifth week of Java Programming Study summary 20165218 2017-2018-2 Textbook Study Contents 7th Chapter Inner class and exception class inner class
    • Defining another class in a class, outer-nested and inner classes
    • Inner classes can use member variables and methods in an outer-nested class
    • Inner classes cannot declare class variables and class methods
    • For use only with outer-nested classes
Exception class
    • Try-catch statements

      try{可能发生异常的语句}catch(ExceptionSubClass1 e){...}catch(ExceptionSubClass2 e){...}

      Once the try section throws an exception object, the try part immediately ends and goes to the appropriate catch section, or you can throw intentionally throw an exception.

Assertion
//格式一assert booleanException;//如果booleanException为true,继续执行程序;否则立刻结束//格式二assert booleanException:messageException;//如果booleanException为true,继续执行程序;否则输出messageException,结束执行
Problems in code debugging and the resolution process
    • Question 1: The text of the No. 286 page of the textbook starts running as follows

    • Issue 1 Solution: Change line 12th File f = new File("F:\\JAVAcode\\Ch10\\src","Example10_4.java"); , which is the path to my own code, to run normally

Code Hosting

Last week's summary of the wrong quiz

Textbook Page 77

If there are class variables in the class, when multiple different objects are created with the new operator, the class variable assigned to these objects occupies the same memory, and changing the class variable of one object affects the class variable of the other object, that is, the object shares the class variable .

Resources
    • Java Learning Notes (8th Edition)

    • Java Learning Note (8th Edition) Learning Guide
    • ...

The fifth week of Java Programming Study summary 20165218 2017-2018-2

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.