20165217 2017-2018-2 "Java Programming" Fifth Week study summary

Source: Internet
Author: User

20165217 2017-2018-2 "Java program design" Fifth week study summary textbook study summary Unite 7
  • Inner class: Java supports declaring another class within a class, such that a class is called an inner class, and a class containing an inner class is called an outer class of an inner one.
  • Outer-Nested class: A class that contains an inner class, called an outer-nested class of an inner class.
  • Anonymous class: An anonymous class related to a class is a subclass of the class that is not clearly defined with a class declaration, so it is called an anonymous class.
  • Custom exception classes: A method can declare a number of possible exceptions using the throws keyword, throw the exception with the Throw keyword, and then invoke a possible exception in the Try-catch statement. Catch is the catch that catches the exception object thrown by the Throw keyword.
  • Assertion: Declares an assertion statement with Assert. Assertion statements are used in the debugging phase of code.

    Unite 10
  • File class: The object of the file class is primarily used to obtain some information about the files themselves. The construction method for creating a file object has a file (string filename), a file (string directorypath,string filename), and a file (file dir,string filename) Such 3 kinds.
  • File byte input stream: typically includes 4 basic steps: Setting the source of the input stream, creating an input stream to the source, letting the input stream read the data from the source, and closing the input stream.
  • File byte output stream: typically includes the four basic steps of giving the destination of the output stream, creating an output stream pointing to the destination, letting the output stream write data to the destination, and closing the output stream.
  • The OutputStream subclass creates an object that is a byte output stream, which is also written sequentially.

  • The subclass of reader creates an object that is a character input stream, which is also read sequentially.
  • Serialization and object cloning

  • Parsing files using scanner

    Problems in teaching materials learning and the solving process
  • Question 1: When we learn that Java uses Try-catch to handle exceptions, it seems to me that some loops can achieve similar results, even default. So why introduce try-catch this kind of processing mechanism?
  • Problem 1 Solution: After looking up some information and asking classmates, I found that there is a big deviation. Try-catch is used to catch anomalies, and anomalies are not foreseen, at the same time, the anomaly is also uncertain, there is no way to use the loop body that condition to judge the execution. Try-catch belongs to a sequential structure that jumps to catch exceptions when an exception occurs, and then uses catch to handle the exception. And the loop body words are selected according to the conditions, and Try-catch is first executed, if the error is found and then transferred, the various anomalies can not be generalize.

    Problems in code debugging and the resolution process
  • There was a problem uploading the code (not resolved)

    Https://gitee.com/tushuguan/20165217ye_quan.git
Last week's summary of the wrong quiz
    • Wrong question 1 and understanding: Variables declared with a class are called objects.
    • Wrong Title 2: The following description of the overload is a B. The constructor method cannot be overloaded.
      Reason: The understanding of the knowledge point is not thorough.
    • Wrong question 3 and understanding: Access modifiers range from large to small sorted correctly: Public-protected-private
    • Error 4 and understanding: The difference between a class method and an instance method: Object Invocation instance method, object, class name call class method, instance method operation instance, class variable, class method operation class variable.

      Summary of this week's study

      This week's teachers and teaching assistants to summarize the results of the previous weeks, my results are not ideal, it may be my study is not hard enough, so in this week's study, I spent a lot of time to watch the video, and ask the students, the previous existence of some of the difficulties solved, and in the process of tapping the code now, May be knocking more, knocking more efficient, there are fewer problems. Learning Java may really help my future very little, but I suddenly found such a problem, learning Java is more like my own learning ability of a test, in the future work life, there will be many new things, so efficient learning ability may be a great help to my future, So I decided to spend more time and energy on my studies while exercising and reading.

20165217 2017-2018-2 "Java Programming" Fifth Week 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.