Java FAQ _09 Basic Class Library (001) _lang Package what is the function

Source: Internet
Author: User
Tags stack trace

Click to enter _ more _java FAQ-base Class Library

1. What is the function of Lang package

The Java.lang package is the core of the Java language and provides the underlying classes in Java. The basic classes include the Basic object class, the class class, the string class, the basic type of wrapper class, the basic math class, and so on. Let's introduce the Java.lang package in Java 8. Main classes such as:?

Broadly, the Java.lang package is divided into three categories: types, tools, systems, respectively, the following are the more commonly used classes:

Type

    1. object base class
      Object, which is the root class of Java.lang, is also a superclass of all classes.

    2. class
      Class, which is used to represent the types of classes and interfaces. The class object is automatically constructed by the DefineClass method in the class loader called by the JVM when it is loaded.
      ClassLoader, responsible for loading classes.
      Compiler, as a placeholder for the compiler, does nothing and is only used to support Java-to-native code compilers and related services.

    3. Basic Type
      The wrapper class for the base type, including Boolean, Character, Byte, short, Integer, Long, Float, Double, where the numeric type is the number class. Learn about wrappers look here: What is the basic type wrapper
      String, class of strings. Understand the string look here: what is a string

    4. character Sequences
      StringBuffer, StringBuilder, variable sequence of characters. See here: What's the difference between stringbuffer/stringbuilder?
    5. Enumeration
      Enum, which is the public base class for all enum types.

    6. Package
      Package, which contains information about the Java packages.

    7. No type
      void, which indicates a reference to a class object of the keyword void and cannot be instantiated.

    8. iterators
      Iterable, an iterative interface that implements an interface that can use iterators for object traversal.

Tools

  1. Mathematics
    Math, Strictmath, provides basic numeric operations such as exponential, logarithmic, square root, and trigonometric functions. In general, math calls the Strictmath method to complete the implementation. There is also a Java.math package in Java that mainly provides classes for performing arbitrary precision Integer Arithmetic (BigInteger) and arbitrary precision fractional arithmetic (BigDecimal).

  2. Safety
    SecurityManager, a class that allows an application to implement security policies.

  3. Annotations
    Override, the method in the markup class is the method that implements/overrides the parent class.
    Suppresswarnings, cancels the warning for the flagged element. Read the Java annotations here: what are the annotations
    System

  4. Process
    Process, abstract class of processes.
    Processbuilder, which is used to create operating system processes.
    Processenvironment, the running environment parameter of the process.
    Processimpl, the implementation class for the interface.

  5. Threads
    Thread, which executes threads in the process.
    Threadgroup, a thread group that represents a collection of threads. It forms a tree structure that can contain other thread groups, except for the thread group of the root node, each with a parent thread group.
    ThreadLocal, provides a variable for the thread.

  6. Run
    Runnable, the interface can be run, all thread should implement it.
    runtime, a runtime class that associates an application with its running environment.
    Runtimepermission for run-time permissions.
    Systems, many of the system-level properties and control methods are placed inside the class.

  7. Stack
    Stacktraceelement, an element in a stack trace, each of which represents a single stack frame (representing a method call).

  8. Exception
    Throwable, exception base class, all exceptions in Java inherit from it. Read more about exceptions here: What is an exception in Java

Java FAQ _09 Basic Class Library (001) _lang Package what is the function

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.