Click to enter _ more _java FAQ-base Class Library
1, util package has what function
The Java.util package provides the underlying tools classes in Java. Includes base classes such as the basic Set framework and common tool classes. Main classes such as:
?
The Java.util package is broadly divided into two categories: collections, tools, and the following are some of the more commonly used classes:
Collection
Bit Collection
BitSet, only 0, 1 collections are stored.
Data Collection
Collection, a common collection container, including list, DataSet set, queue queues.
MAP, key-value pair container.
Dictionary, dictionary containers, and maps are very similar.
Some of the data collection containers provided by Java are often used in the development process, and different containers have their own features that apply to different scenarios. Understanding the collection container look here: [What is a collection container][2]
[2]:
Collection Tools
Collections, which provides common tools for collection containers.
Arrays, which provides commonly used tools for arrays.
iterators
Iterator, an iterator that uses iterators to traverse an object.
Tools
Character Set
BASE64, provides encoding and decoding tools for Base64.
Date Time
Date, which provides the operation and processing of dates and times, and the time to get the current system.
Calendar, a more powerful date processing tool than date, can be internationalized and the official recommended date tool.
TimeZone, describes the time zone and provides an international foundation for the calendar.
Currency
Currency, describe the currencies of each country.
Comparator
Comparator, you can customize the sorting of a collection object or array object by implementing the Comparator interface.
Data Statistics
New features in Intsummarystatistics, Longsummarystatistics, Doublesummarystatistics,java 8, mainly used to statistically measure common statistical values of elements in a numeric array, such as: Maximum, Minimum, Average, sum, etc. Often used in conjunction with stream.
Monitor
EventListener, event listeners, want to use event snooping to implement it.
EventObject, the event object that contains the data corresponding to the event, requires the custom class to inherit it.
Observer Pattern
Observable, the object interface to be observed, the object to be observed to implement the interface.
Observer, the observer needs to implement the interface, when the observable object changes, Observer be notified, you can do the corresponding work.
localization
Locale, which describes the specific geographic, political, and cultural regions through which Java internationalization can be achieved.
Object Tools
Objects, provides common tool methods for Java objects, such as equality, comparison size, and so on.
Optional, which can be hosted as a null container object, can avoid problems caused by null values by returning the object.
Random number
Random, which is used to generate stochastic numbers, the principle is to generate pseudo-random numbers by the number of seeds.
UUID, you can generate 128-bit long, non-repeating numbers. It combines the machine's NIC, local time, and random number to generate the GUID. Theoretically, if a machine produces 10 million GUIDs per second, it can be guaranteed (in a probabilistic sense) that it will not repeat for 3,240 years.
text
Scanner, the main function is to simplify text scanning, and other functions such as retrieving text, parsing strings and basic types.
Scheduling
Timer, Timer tool, starts a separate thread outside the main thread to perform the specified scheduled task, which can be executed once or repeatedly.
TimerTask, a task that can be performed by a timer, implements the Runnable interface.
Java FAQ _09 Basic Class Library (002) _util Package what is the function