JAVA EXAM3 复习提纲

2023-05-19,,

【Practice11_Zipcode_ArrayList】

Zipcode class:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//3 variables: zipcode, city, county, and compare by county

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//define getter and setter so that it could be used to get the variable

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

County:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//two variables: county and count, and define the getters & setters

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

Main:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//1.read the files,

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//no need to define here since it was passed later on

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//use += for string

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//2.

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

ZipcodeComparator:

compare the zipcode by the county?

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//2.

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
span.s1 {text-decoration: underline}
-->

CountyComparator:

compare the county by their count

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//read file by passing into file's name

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//define two lists to use

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//3 initialize zipcode

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline ; color: #000000}
-->

//sort the list using the Collections.sort

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//4 initialize cities

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//append the new county's name to the string's name

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//split up all the country words, 5.count the zipcode

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//new up a number list to store the number accounts

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//count the numbers one by one

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//append the count to the number list

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//new up a county object and add it to the state list 6. count the cities

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//sort after appended to the list using Collections.sort

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//print out the state's names

【Zipcode Hashmap】

zipmap:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//initialize variables : city/country/zipcode, same constructor

main:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//split the words and set up zipmap object

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//dirty number? add only if they equal in both city and county

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//add to indicate duplication for further query

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//just one city/county equal?

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//using printf to format output

【movie】

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

Genre class:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//define variables: string and arraylist

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//define compare to method and compare via one variable

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//if o comes later, from small to big

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//override the hashcode method

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//override the equals method

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

Movie class:

same

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
span.s1 {text-decoration: underline}
-->

MyFlix class:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//loadMovies:

load movie information and the movie genres information

//loadGenres://use iterator to parse all the movies, //get next movie, //get next genre,

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//if not contain the genre, add to the new list,

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//if contains the genre, add to the list

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//rewrite, add to result if it contains

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//rewrite: print by using iteration

【words】

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
span.s1 {text-decoration: underline}
-->

Word:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//define toString here : word + ": " + meaning

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//should notice the lower case situation

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

Dictionary class:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//re: put into map according to the requirement

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//get a new word

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//add up on

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//or add a new list

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

searchWordList:

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
span.s1 {text-decoration: underline}
-->

//re: find in the wordList, use found variable to controll

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

searchMultiMap

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->

//print out the results found in the map

<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
span.s1 {text-decoration: underline}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
span.s1 {text-decoration: underline}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo; color: #3f7f5f}
-->
<!--
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px Menlo}
-->

JAVA EXAM3 复习提纲的相关教程结束。

《JAVA EXAM3 复习提纲.doc》

下载本文的Word格式文档,以方便收藏与打印。