Java Basics Fragmented Knowledge points Summary (continuous replenishment)

Source: Internet
Author: User

1. Overloading: Different parameters with the same name

Override: same name with same parameter return type (the method body is consistent with the parent class), only exists in the inheritance relationship (polymorphic), requires the parent class to use the original Method super (), the subclass function access adornment permissions can not be less than the parent class.

2.OOP (Object Oriented Programming): Object-Oriented Programming

Three major features of OOP: inheritance, polymorphism, encapsulation

3.Java Cross-platform features: Java compiled to generate bytecode (bytecode can not be directly run, machine code to be able to), different platforms compiled by the generation of bytecode is the same, but the JVM will be based on the current platform to translate bytecode to match the current platform specifications of the machine code, so that the implementation of a write, run everywhere.

4. Modifier Permissions:

Access rights Class Package Sub-class Other Packages
Public
Protected X
Default X X
Private X X X

5.Java Data type:

① Basic types (value types): Boolean (1-bit), char (16-bit), byte (8-bit), short (16-bit), int (32-bit), long (64-bit), float (single-precision, 32-bit), double (dual-precision, 64-bit);

② Reference type:

    • A reference type points to an object, and a variable that points to an object is a reference variable. These variables are specified at the time of declaration as a specific type, such as Employee, Puppy, and so on. Once a variable is declared, the type cannot be changed.
    • objects, arrays are reference data types.
    • The default value for all reference types is null.
    • A reference variable can be used to reference any type that is compatible with it.
    • Example: Site site = new site ("Runoob").
    • Automatic type conversion

Low   ------------------------------------>   High byte,short,Char ,int, long,float       

6. Basic types of declarations:

Long A = 100000l,float F1 = 234.5f
"L" is theoretically not case-sensitive, but if written "L" is easily confused with the number "1", it is not easy to distinguish. So it's best to capitalize;

Do not add the default is Int,int to Long is safe, so will automatically turn, can compile through, but if the value of more than int range is not plus L, will directly error;
Floating-point numbers without F default is double type, double to float may lose precision, because it does not automatically go, compile is not possible.

7.

Java Basics Fragmented Knowledge points Summary (continuous replenishment)

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.