Introduction to Java Class Libraries and Commonly Used Class Libraries

Java class library concept: Java's application program interface (API) is organized in the form of packages, each package provides a large number of related classes, interfaces and exception handling classes, the collection of these packages is the Java class library

 

A package whose package name starts with Java is a Java Core Package;

A package whose package name starts with Javax is a Java Extension Package, such as the javax.swing package;

 

Commonly used Java Core Package (Java Core Package)

  1. 1.       java.lang      The basic class library of the Java programming language
  2. java.applet All classes needed to create an applet
  3. java.awt classes for creating user interfaces and for drawing and managing graphics and images
  4. java.io system input and output through data streams, object sequences, and file systems
  5. All classes of java.net used to implement network communication applications
  6. 6.       Various common toolkits such as java.util       collection classes, time processing modes, date and time tools, etc.

other

  1. java.sql Classes for accessing and manipulating data from Java standard data sources
  2. java.test classes and interfaces for manipulating text, dates, numbers, and messages in a natural language-independent manner
  3. java.security Some classes needed to design network security solutions
  4. java.beans All classes needed to develop Java Beans
  5. java.math Concise integer arithmetic and basic functions for decimal arithmetic
  6. java.rmi All classes related to remote method invocation

 

Common Java Extension Packages (Java Extension Package)

1. javax.accessibility defines a mechanism for mutual access between user interface components

2. javax.naming.* provides a series of classes and interfaces for naming services

3. javax.swing.* provides a series of lightweight user interface components, which are commonly used packages for Java user interfaces.

 

 

Note 1: The most important and commonly used are 1 and 6, which have been marked in bold and need to be mastered

Note 2: When using Java, except java.lang, other packages need to be imported by import statement before they can be used.

 

 

Focus on the content: java.lang and java.util.

java.lang

This package is called the java language package and is automatically imported by the compiler. It can be used without import statement in the program. The classes and interfaces it contains are necessary for all actual Java programs.

  1. object class
  2. Math (Math)
  3. data type class
  4. thread class
  5. String class (String class and StringBuffer class)
  6. System and runtime classes (System class and Runtime class)
  7. Error and exception handling classes (Throwable , Exception , Error)
  8. Process class (process)

 

 

java.util package

1. Date class, calendar class ( Data , Calendar , GregorianCalendar )

2. Random number class ( Random )

3. Bit operation class ( BitSet )

4. Vector class ( Vector )

5. Data structure class ( Stack )

6. Hashtable class (Hashtable)

7. StringTokenizer类

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325213216&siteId=291194637