No.20169204 Learning Summary, Fourth Week
Summary of Teaching Content
This week, I make a lot of mistake. I have write 1-4 chapters code in the text and compile error too much. Then, chapter 11,chapter12 and chapter13 are difficult for me.
Enmums
These session, We will learn how to create and use enums in this chapter. As an example,consider the CustomerType enum definition in Listing1.
Listing1:
You can use enums as members of a class. You use this approach if the enum is only used internally inside the class. Beside, when you define an enum, the compilercreates a class definition that extends the java.lang.Enum clss. This class is direct descendant of java.lang.Object. We should memorize the properties about the enum:
There is no public constructor,making it impossible to instantiate
It is implicitly static
There is only one instance for each enum constant.
You can call the method values on an enum in order to iterate its enumerated values.This method returns an array of objects. If you call getClass()getName() on theseobjects, they will return the Java qualified name of the enum. See the next section "Iterationg Enumerated Values" for more details on this.
You can call the name and ordinal method on an object returned by values to get the name and ordinal value of the instance,respectively.
Working with Dates and Times
Java 8 brings with it a new Date-Time API to replace the old API that centered around the java.util.Date class. In this chapter you have learned to use the core class in the new API,such as Instant, LocalDate, LocalDateTime, ZonedDateTime, Period and Duration, as well as learned to format and parse a date-time. I think this section usually works program should not be a lot, but in the Android development process for the subsequent, may often use, this is amazing, it can not only get the local time, you can also get other countries at the time. This chapter is relatively simple to understand, but there are too many code we need to remember.
The Collections Framework
When writing an object-oriented program,you often work with groups of objects. In Chapter 6,"Arrays" you learned that arrays can be used to group objects of the same type. Java comes with a set of interfaces and classes that make working with groups of objects easier: the Collections Framework.
The collection framework that I had heard was last year in a Programing Contest. The winner has a good technique through using the collection framework.
The main type is the java.util.Collection interface, which has three direct subinterfaces: List,Set, and Queue. Each subtype comes wiht several implementations. There are synchronized implementations and there are unsynchronized ones. The latter are usually preferable because they are faster.
Problems and Solutions in Teaching Materials
None
Problems and Solutions in Code Debugging
I don't know why my code error, unless cuted the package **. In the follwing:
Code hosting
- Code Submission Process Screenshot:
- The Number of Code Screenshot:
- run find src -name "*.java" | xargs cat | grep -v ^$ | wc -l
- run find src -name "*.java" | xargs cat | grep -v ^$ | wc -l
Sumary of the test last week
In last week's class, I have a small test to be caught off guard. It is a hard time for me, there are so many mistake which I made, and remind me to study hard in this week. Recall the mistakes before, mostly focused on the basic concept of the textbook and the related tutorials not proficient,as to my answer the question that what's the three most popular IDE environment was wrong!
So, this week, I have paid my attention on the textbook, more focus on some basic knowledge, rather than eager to programming. Carefully read the tutorial, the environment is configured accurately, standardized format for the follow-up study to lay a good foundation for the environment.
Feeling
Three weeks later, the learning method is not very skilled, but I am determined according to this method, continue to study, will have unexpected results. In fact,I learned the basic knowledge of Java was so few in past two weeks, far less than to learn programming much past time. This is due to a lack of understanding of the nature of the compiler. After two weeks of exploration and learning, I gradually understand the operation of the Ubuntu skills, but also enjoy the programming to bring a happy mood. I think I'm more interested in programming.
Finally, thanks to my classmates and teachers help in everything! Thank you!
Learning progress bar
Code Line | Bolg | Time | |
---|---|---|---|
Target | 5000 | 15 | 15 |
First week | 200/200 | 1/1 | 3/4 |
Second week | 300/500 | 1/1 | 3/4 |
Three week | 340/400 | 1/1 | 4/6 |
Fourth week | 381/400 | 1/1 | 6/6 |
Reference
[Java for Android 2nd Edition]
[Java Study notes(8th Edition)Learning guidance]