First, the known number of storage arrays QQ number, QQ number up to . 11 bit , shortest . 5 bit String [] strs = { "12345 ", "67891", "12347809933", "98765432102", "67891", " 12347809933 "} .
Inside the array of all qq numbers are stored in the LinkedList in , the list to delete duplicate elements , will list all the elements are iterative and Enhanced for printed loop.
Collection set of exercises
A, generating 10 th 1-100 random numbers and placed in an array, the array is greater than equal to 10 numbers into a list set, and printed to the console.
Object-Oriented
1. Define the phone category Phone
Behavior: call (call), text messaging (sendMessage)
2. Define Interface IPlay
Behavior: playing games (play)
3. Define the old phone class (OldPhone) class inherits phone
Behavior: inherit the behavior of the parent class
4. Define a new phone class (NewPhone) inherited phone class implements an interface IPlay
Behavior: Behavior inherit the parent class, override the method to play the game
The defined test class (the Test), creates an object and call the method, the following operating results:
Old cell phone
Old phones to send information
New cell phone
The new phones to send information
New cell phone to play games
Map collection
There are two arrays, the first array reads: [Heilongjiang Province , Zhejiang , Jiangxi , Guangdong , Fujian Province ] , a second array is: [Harbin , Hangzhou , Nanchang , Guangzhou , Fuzhou ] , the first array elements as the key, the second array element as the value stored in the Map collection. Heilongjiang Province as { = Harbin , Zhejiang = Hangzhou , ...}
Byte write data output stream
Description :
Receiving a user input from the console cycle student information, the input format: school - student names
Student information will be saved to D disc following stu.txt file, a student information occupy a row of data.
When the user enters end stop input.
answer
Procedure :
1. Use Scanner class for keyboard input data
2. Create a byte input stream object associated object
3. Using student data endless loop stop receiving user input
4. The student receives user-entered data
5. if the content of the input is determined End , a loop is terminated, stop input. Otherwise write data to a file.