Main Java Getting Started

Source: Internet
Author: User

The main function can be overloaded. JVM Unique identification parameter (string[] variable name) args is the only place that can be changed.

When the JVM calls the main function, it passes in the new string[0]

Parameters of the command Java class name main function:
The JVM stores the parameters in the string[of the main function].
Split open array space with spaces

Document Comments/** Text */Author author version
jacadoc-d Directory-author-version
Classes that must be public for the actual situation can be used to generate the Help document

A constructor that has an empty argument by default in a class
This default constructor has the same permissions as the owning class
If the class is modified by public, the default constructor is also with the Publick modifier
If the class is not modified by public, then the default constructor is not public decorated

The permissions of the default constructor change as the class changes.

Design pattern: The most effective way to solve a certain kind of problem.

23 Design Patterns in Java

Single-column design mode: Resolves a class that only has one object in memory.

To ensure that the object is unique:
1 to prevent other programs from building the object too much. Prevent other programs from establishing this class object first.
2 also for other programs to have access to the class object, you have to customize an object in this class.
3 in order to facilitate the access of other programs to custom objects, you can provide some external access.
Code embodies
1 privatizing the constructor
2 Creating an object of this class in a class
3 provides a way to get to the object.

How to describe things and how to describe them.
Add the above three steps when you need to guarantee that the object of the thing is unique in memory.

The A Hungry man class creates an object as soon as it enters memory.
Lazy class one enters memory without creating an object, and only when the static function method is called is the object established.

Keyword synchronized only one object at a time to perform the interview exam, plus a lock to determine if there are objects in the No, there is no go in

Main Java Getting Started

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.