Java basic library

Source: Internet
Author: User

Java provides programming interface APIs for programmers in the form of the basic Class library JFC (Java Foundation Class). classes in the Class library belong to different packages according to their purposes.

(1) java. lang Package
The most common Java package belongs to this package. You can use the classes in this package without injecting this package into the program. You can use these classes to design the most basic Java program.
String class, which provides processing methods such as String connection, comparison, character locating, and String printing.
The StringBuffer class provides further processing methods for strings, including substring processing, character addition and insertion, and character replacement.
System class, which provides read/write methods for standard input/output device io, including in/out control for keyboard and screen. Common System. out. print () and System. out. println () are the methods provided by the output stream of static variables of this class.
Thread class, providing Java multi-Thread processing methods, including Thread suspension, sleep, termination, and running.
Math class provides a large number of mathematical calculation methods.
Object class, which is the ancestor class of the Java class. This class provides all Java classes with methods to call Java garbage collection objects, as well as methods to wait and wake up based on Object thread security.
Throwable class, which is the ancestor class of Java errors and exception classes and provides methods for Java to handle errors and exceptions.

(2) java. awt package
The class in this package provides a graphical interface creation method, including button, text box, list box, container, Font, color and graphics, and other elements.

(3) javax. swing package
This package provides a graphical interface created in Java 100%. The interface elements created by the class of this package can be adjusted to the interface style of various operating systems, supporting the development of interfaces on various operating platforms. In addition, the swing package provides tree controls, Tab controls, and table controls. Java. many classes in the swing package are from java. the classes of the awt package inherit from Java. the awt package is designed to maintain technical compatibility, but javax should be used whenever possible. swing package to develop the program interface.

(4) java. io package
The class of this package provides data stream-based system input/output control, reading/writing of files and objects, and more common classes include: bufferInputStream, BufferOutputStream, BufferedReader, BufferedWriter, DataInputStream, DataOutputStream, File, FileReader, FileWriter, FileInputStream, and FileOutputStream.

(5) java. util package
This package provides classes for creating complex data structures, such as time, Date, Random number, list, set, hash table, and stack. Common classes include Date, Timer, Random, and sort list.

(6) java.net package
This package provides network development support, including server Serversocket class that encapsulates Socket functions, client Socket class, and URL class that accesses various resources on the Internet.

(7) java. applet package
This package has only one Applet Class, which is used to develop or embed Applet small applications on a webpage, so that the webpage has stronger interaction and multimedia and network functions.

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.