Java Core Technology Learning notes

Source: Internet
Author: User
Tags constant final inheritance

Mastering Java Core Technology is the key to learning and mastering Java technology, with 17 points below to explain these Java core technologies.

No more inheritance in 1.Java, but instead of multiple inheritance with interfaces

2. When you run a compiled program, the Java interpreter always executes from the code in the main method of the specified class, so you must have a main function in the execution code.

3.Java is a typical strongly typed language, that is, you must declare the type of the variable, there are 8 types in Java, 6 numeric types (4 integers and 2 floating-point types), one character type, and one Boolean type.

4. Force type conversions:

int NX = (int) x; (Syntax: Enclose the target type with parentheses followed by the variable to be converted);

5.Java cannot define a local constant for a separate method, such as the main method, but only a constant for a class that is used by all methods of the class, so it is often called a class constant. Such as:

class UsersConstants{
public static final double g = 32;

public static final double main(String[] args){
   System.out.println(g);
}
}

Note: Constants are defined outside the main method and must have the keyword static final;

6. Substring of string:

String str = hello"";
String str1 = str.substring(0,4); //输出hell

7. Do not use the = = operator to test whether two strings are equal, the operator can only determine whether two strings exist in the same location.

With equals.

String str = "hello";
str.equals("hell"); // return false;

8. The behavior, state, and identity of the object

9. Process-oriented and OOP

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.