Java Learning First day basic concept learning

Source: Internet
Author: User

First day of Java


1, path and the role of Classpath
Path: The paths to the system-configured executable program.
The load path of the Classpath:*,class file, and the class file in the specified path is found by CLASSPATH when the Java command is used to interpret the class.

2. Data type partitioning in Java:
' Basic data type:
|-Numerical Type:
|-integer: BYTE, short, int, long; 0
|-Real: float, double;-0.0
|-character: char; ' \u0000 '
|-Boolean: boolean;->false
' Reference data type: class, array, interface;->null

3. Please explain & and &&, | | The difference?
' Logical operation:
|-& | In the case of logical operation, all the judging conditions must be executed;
|-Short circuit and (&&) in front of conditional return false, the following conditions are no longer judged;
|-Short circuit or (| | When the previous conditional returns TRUE, the following conditions are no longer judged;
' Bit operation:
|-&: Indicates implementation bit and operation, when the two-bit data is 1, the result is 1, one is 0 result is 0;
|-|: Represents the implementation bit or operation, when two bits of data has a 1 of the time the result is 1, 0 of the time the result is 0.

4. Method: A block of code that can be called repeatedly, the definition structure of the method (which is defined in the main class and called directly by the Live method):
public static return value type method name ([parameter type variable, ...] ){
[Renturn [return value];];
}
Method Overloading: The method name is the same, the type and number of parameters are different, but the method overloads do not require the return value must be the same, but from the actual development, the method's return value as far as possible uniform.

5. Please explain the difference between public class and class.
' Public class: file name and class name to be consistent, in a X.java file can only have a public class definition;
' Class: File name can and class name not always, in a *.java file can define multiple classes at the same time, after compilation will form a different *.class file.

Java Learning First day basic concept learning

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.