Beginner Java's understanding of certain issues

Source: Internet
Author: User

1 What does each word mean in the following code?

Public y① class ② Hello ③ {

Public Static  voidMain⑦(string[] args)⑧{

}

}

① and ④ indicate public access to other classes

② is a declaration of a class

③ is the name of the class

⑤ represents static

⑥ represents no return value

The name of the ⑦ method a program has and only one main method is the Main method

⑧ must pass an array of string to this method when the parameter is named args.

How does the 2Java work?

source code → compiler → output → run on Java virtual machine

3 What is an identifier?

Identifiers are symbols that are used to give names to variables, methods, classes, and so on in Java.

4 are there any rules for naming identifiers?

(1) Consists of letters, numbers, underscores, dollars ($), cannot contain special characters, and cannot begin with a number.

(2) cannot be a Java keyword and a reserved word, but can contain. For example void can not but myvoid can.

(3) identifiers are strictly case sensitive.

(4) It is best to reflect its content, that is, to be known.

5 What is a variable? What is a constant?

A variable is a value that can be changed during a program's run. We can compare it to a box where we can put anything that can be put in it. You can also replace something in the box when you need to put something else. The constant that corresponds to it is the value that cannot be changed during the run.

What is the description variable used in 6Java?

(1) Variable type;

(2) variable name;

(3) Variable value;

For example: Int (variable type) A (variable type) = 5 (variable value);

We can tell from the third question that the value of a variable can vary, so:

Int a = 5;

c=t;

The value of output A is 6; we can describe it more graphically, such as: Comparing variables to hotel rooms, comparing variable types to room types, and comparing variable values to room guests, which is easier to understand.


This article is from the "popular tastes" blog, make sure to keep this source http://asalawys.blog.51cto.com/12008007/1856695

Beginner Java's understanding of certain issues

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.