Java syntax details (for personal use)

Source: Internet
Author: User

Modifier (access range size order) Public completely discloses protected. The same package or subclass does not have the same package private class.

Abstract class cannot be modified by the static modifier at the same time

In the interface, the method defaults to public abstract modifier. The default variable is public static final modifier.

Abstract, final, abstract, static, abstract, and private cannot specify switch () at the same time. Only bytes, short, Int, char (long, float, double) can be judged)

Exception includes check exception and runtime exception. Check exception can be checked by the compiler. runtime exception is not checked by the compiler, but can be caught by catch.

The class defined in the class includes: 1 member class: Class 2 local class defined by the member class as the method local variable Class 3 Anonymous class generated by the new class without a name

Anonymous class instance generation method: New superclass name () {...} Or New Interface Name (){......}

How to Use member class: topclass. memberclass

Anonymous class cannot define sub class (because you do not have a name) and cannot be defined as abstract class. constructor cannot be defined (note)

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.