1 What does each word mean in the following code?
Public y① class ② Hello ③ {
Public④ Static⑤ void⑥Main⑦(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