Introduction of today's contentU Knowledge ReviewU static keywordU code blockChapter 1th Knowledge Review1.1 Review of methods1.1.1 Case Code One:Package com.itheima_01;/** Requirements: Define a method to calculate the number of two and invoke it
Static {} (static block) is executed only once when the class is loaded. It is generally used to initialize static variables and call static methods, next we will discuss in detail the features and applications of this statement block.1. During a
Static variables and static methodsThe most basic usage of the Static keyword is:1. Variables modified by static belong to class variables, which can be referenced directly by the name of the class, without the need for a new class to2. The method
The "static import" mechanism is introduced in j2se 1.5. With this mechanism, you can use static members by skipping the class or interface name. This article describes how to use this mechanism and the precautions during use.
In Java programs,
The "static import" mechanism is introduced in j2se 1.5. With this mechanism, you can use static members by skipping the class or interface name. This article describes how to use this mechanism and the precautions during use.In Java programs,
Wrapper class, Math, date format processing
Packing class
Math:random (), round ()
Date format processing
Java advocates that thought is everything, but our basic data type is not a class, that is, there is no object concept,
PowerShell stores information in objects, each object has a specific type, and simple text is stored in the System.String type, and dates are stored as System.DateTime types. Any. NET object can return its type through the GetType () method, which
1. Math Object1.1 Introduction Math object is a mathematical object that provides mathematical calculations of the data, such as obtaining absolute values, rounding up, and so on. No constructors, cannot be initialized, only static properties and
1. Math Object1.1 Introduction Math object is a mathematical object that provides mathematical calculations of the data, such as obtaining absolute values, rounding up, and so on. No constructors, cannot be initialized, only static properties and
All versions are supported.
PowerShell can use. NET static methods, such as the following some of your common methods:
Copy Code code as follows:
[Math]::round (7.9)
[Convert]::tostring (576255753217, 8)
[Guid]::newguid ()
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.