Java Basic theory--basic syntax

Source: Internet
Author: User

Tag: element content has no rule relationship type underlying data type declaration overload

1. Translation rules for 8 basic data types in Java

Automatic conversions are converted in order from low to high. is an automatic hermit conversion, the priority relationship between different types of data is as follows:
Low---------------------------------------------> High
Byte,short, int-long-float-double

2. Two-dimensional array

type[][] i = new type[2][3];

Each element of a two-dimensional array is a one-dimensional array, and these arrays are not necessarily equal in length.

When declaring a two-dimensional array, you can specify only the first-dimension size, the second-dimension size, and then the array of different lengths. Note, however, that the first-dimension size cannot be empty (you cannot specify only the number of columns without specifying a row).

3. Overloading

The difference between overloads is that the parameters are different:

(1) different parameter order (2) different parameter types (3) different number of parameters

The formal parameters do not allocate actual memory space;

Data passing on a reference type is also a value, but this is an address, so it is possible to change the value of the original reference type variable in the accepted method.

Java Basic theory--basic syntax

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.