First, Javase (18) Map class, Collections class

Source: Internet
Author: User
Tags map class shuffle

Tagged with: GPO for interview with Lis Static cannot BSP custom integer max

1:map (Master)

(1) An object that maps the key to a value. A map cannot contain duplicate keys, and each key can be mapped to at most one value

(2) What is the difference between map and co11 ection?

A:map stores elements that are key-value pairs, unique keys, and values that can be duplicated. Couples on

B:co11ecti. n stores a single occurrence of an element, a sub-interface set element is unique, and a sub-interface list element can be duplicated. Bachelor

(3) Overview of Map Connection denier functions (self-completion)

A: Add Features

B: Delete Feature

C: Judging function

D: Get Features

E: Length function

(4) Traversal of the Map collection

A: Key to find the value

A: Gets the collection of all keys

B: Iterate through the collection of keys to get each key

C: Find the value according to the key to the collection

B: Key-value pair object find key and value

A: Gets the collection of all key-value pairs of objects

B: Iterates over the collection of key-value pairs of objects, getting each key-value pair of objects

C: To get keys and values based on the key value of the object

(5) Practice of HashMap Collection

A:hashmap<string, string>

B:hashmap<integer, string>

C:hashmap<string, student>

D:hashmap<student, string>

(6) Practice of TreeMap Collection

A:treemap<string, string>

B:treemap<student, string>

2:collections (understanding)

(1) is a tool class that operates on a collection

(2) Interview questions: The difference between collection and collections

A:co11ection is the top-level interface of a single-column collection with two sub-interfaces list and set

B:co11ections is a tool class that operates on a collection and can be sorted and looked up

(3) Common several small method (oneself can go API query, the function of each method and arrays similar)

A:public static <T> void sort (list<t> List)

b:public static <r> int BinarySearch (list<?> List, T key)

C:public static <T> T max (collection<?> coll)

D:public static void reverse (list<?> List)

E:public static void Shuffle (List<?> List)

(4) Case

A:arraylist Collection stores the ordering of custom objects

B: Simulated bucket landlord shuffle and licensing

C: Simulate bucket landlord shuffle and licensing and sort cards

First, Javase (18) Map class, Collections class

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.