Java Final review of the JSCP Question Bank study notes

Source: Internet
Author: User

1. in Java, a static method in a class (especially the main method) cannot call a non- static method directly.

When writing an inner class there is a compile error: No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing instance of type E, stating without an instance of an accessible inner class E, you must assign an instance of the appropriate inner class E, such as X.new A (), x must be an instance of E. or

Similarly, if a static function wants to invoke a non-static function of this class, it should first declare an instance of the class .

2. The default access rights are package access rights. Protected access control mode, all classes in the same package and subclasses in other packages are accessible, and visible access is greater than the package.

3. Normal variables for function scope do not have a default value if not manually initialized, but an array on the heap is automatically initialized to the default value.

The range of 4.byte is -128~127.

The order of return in the 5.catch statement block and the finally statement block:

6. Converting a parent class to a subclass using coercion type casting does not give an error, but a run-time fault may occur.

7. Distinguish between Overriden and overloaded. One piece of the pit title:

Occupy the pit. Then fill

Java Final review of the JSCP Question Bank study notes

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.