1. Summary of this week's study
1.1 Summarize the set and generic related content in the way you like (mind mapping or other).
A little bit of a supplement to the last week's summary.
1.2 Choose: Collect code snippets that you think are useful
2. Written work
Collection of this homework question set
1. Deletion of the specified element in the list (title of the topic)
1.1 Experimental summary. and answer: List at least 2 ways to delete elements in the list.
For:
- For loop traversal list
- Enhanced for Loop
- Iterator traversal
Summary of methods for iterating through the elements in a list in Java
How to properly traverse the delete element in list, will you?
2. Count the number of words in the text and sort them by the number of occurrences (problem set)
2.1 pseudocode (Do not copy code, otherwise deduct)
For:
while (true){ 输入String 内容 line; if 输入的line为“!!!!” 退出循环; while(还存在输入){ if 字典中存在 key value +1; else 存入key,value=1; }}sysout(size());内部匿名类创建对象进行比较;for each 输出前十;
2.2 Experimental Summary
For:
The first is to use 7-2 of the method to complete the statistics, but this problem also requires statistical occurrence, you do not find the original practice.
Use HashMap to build a dictionary, key represents a word, value indicates the number of occurrences will be entered into the word one by one into the dictionary, the new list of anonymous inner class, compare value, and then output the first ten.
3. Inverted index (problem set)
The subject is more difficult, do not come out does not matter. But must have own thinking process, must have the submission result.
3.1 Your code runs the result
A: Only "index and print" is completed temporarily
3.2 pseudocode (Do not copy code, otherwise deduct)
For:
Map map = new TreeMap(),key为String,value为ArrayList;ArrayList s = new ArrayList();while(继续输入){ if (遇到("!!!!!")) { break; } else { if(map中没有相应的key) 把单词添加到map中,同时将当前行数的值添加到value中 else 判断是否已经存在于value中,若没有,则添加当前行数到value中 } 创建迭代器,遍历输出;}
3.3 Experimental Summary
For:
The first part reads in the words and the topic 7-2 Similar, then uses the iterator iterator realizes the traversal output;
The second part is still trying to
4.Stream and Lambda
Write a Student class that has the following properties:
private Long id; private String name; private int age; private Gender gender;//枚举类型 private boolean joinsACM; //是否参加过ACM比赛
Creates a collection object, such as a List<Student> number Student of objects within it for subsequent tests.
4.1 Use the traditional method to write a search method List<Student> search(Long id, String name, int age, Gender gender, boolean joinsACM) , and then call the method will id> a value, name is a value, age> a value, gender to a value, the students who participated in the ACM contest to filter out, put into the new collection. Called in Main, and then outputs the result. (: The number of the school, name)
4.2 Use the stream () in Java8, filter (), collect () to write the code with the same 4.1, and test (to show the test data). When building a test collection, in addition to the normal student object, add some null to the collection, and the method you write should handle the null instead of throwing an exception. (: The school number appears)
5. Generic type: Generalstack
The Generalstack of jmu-java-05-collection of title set
5.1 Code for Generalstack interface
5.2 What are the benefits of generics compared to arraylistintegerstack in previous assignments?
For:
In previous jobs, the ArrayListIntegerStack types of elements stored inside were single (Integer) and very limited in size.
With generics (E), there is no longer any restriction on the type of storage, such as the one in the subject, that Integer Double is, Car more functional and more convenient.
6. Select: Generic method
The base reference file is Genericmain and is modified on this file.
6.1 Write Method Max, which returns the maximum value of all elements in the list. The elements in the list must implement the comparable interface. The Max method you write should make string max = Max (strlist) run successfully, where strlist is a list
7. Select: Inverse maximum matching segmentation algorithm
Set the No. 07 Experiment (collection) in the experiment file. doc file, inside the topic 6.
7.1 Write pseudo-code (not directly copied code)
7.2 Your code runs the result.
3. Code Cloud and PTA
Topic Set: jmu-java-05-Collection
3.1. Code Cloud codes Submission record
In the Code cloud Project, select statistics-commits history-set time period, and then search for and
3.2 PTA Problem set complete situation diagram
Two graphs are required (1. Ranking chart. 2.PTA Submission list diagram)
3.3 Count the amount of code completed this week
The weekly code statistics need to be fused into a single table.
| Week Time |
Total code Amount |
New Code Volume |
total number of files |
number of new files |
| 1 |
0 |
0 |
0 |
0 |
| 2 |
0 |
0 |
0 |
0 |
| 3 |
619 |
619 |
12 |
12 |
| 4 |
619 |
0 |
12 |
0 |
| 5 |
970 |
351 |
17 |
5 |
| 6 |
1118 |
148 |
25 |
8 |
| 7 |
1231 |
113 |
28 |
3 |
| 8 |
1707 |
476 |
33 |
5 |
| 9 |
1902 |
195 |
38 |
5 |
| 10 |
2316 |
414 |
43 |
5 |
Can you achieve your goals?
4. Assess how much you understand Java
Try to evaluate how much you understand Java from the following dimensions
| Dimension of |
degree |
| Grammar |
There are still many problems in PTA. |
| Object-oriented design capabilities |
Not yet proficient in using object-oriented thinking to model the problem to be solved |
| Application capabilities |
The feeling is not yet applied |
| Number of lines of code so far |
2316 |
Optional: 5. Use Java to solve real-world problems
There are n courses where each student has a few questions about each course (each subject has a label). Teachers expect to classify the problems of all students, first classifying the problems by course, and classifying the same student's topic in some category. The existing operation process is that each student does not know the subject in his own subjects according to the course classification number after the issue to the Study Committee members to study the unified summary. It is now hoped that a program will be developed to help students categorize and to count which topics in each course do not understand the highest rate. Trying to write out the approximate steps to solve the problem? The contents of each student's document should follow a certain standard to facilitate the process, try to write the specification.
201621123057 Java Programming 9th Week of study summary