Java basic data types and access control characters

Source: Internet
Author: User

1.java Data types

    • Built-in data type:boolean (1), Byte (8), char (+), short (8), int (+), long (+), float (+), double (+)
    • Reference data type: Object, array

2. Modifiers and keywords

    • Methods declared as public in the parent class must also be public in the subclass.

    • A method declared as protected in a parent class is either declared as protected in the subclass or declared as public. cannot be declared as private.

    • The method declared by the default modifier in the parent class, which can be declared as private in the subclass.

    • The method declared as private in the parent class cannot be inherited.

3. Non-access modifiers

    • The static modifier, which is used to create class methods and class variables.
    • Final modifiers, which are used to modify classes, methods, and variables, the final decorated class cannot be inherited, the decorated method cannot be overridden, and the modified variable is not modified after it has been assigned a value.
    • An abstract modifier that is used to create abstract classes and abstract methods.
    • Synchronized and volatile modifiers, primarily for thread programming JV ' a

Java basic data types and access control characters

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.