A small case study of Java

Source: Internet
Author: User
Class test {public test () {} public dosome () {private int I ;}.....}

The above section of JavaCodeThere are two errors:

(1) The second method does not return a value when it is defined (the first method is a constructor without a return value)

(2) When I is defined in the second method, private cannot be added before, because private is not compiled and passed.
The error is illegal modifier for parameter I; only final is permitted.

Blocks valid within {} are invalid. Local variables (variables defined in the method) are in the scope of this method,

Access Control modifiers are unnecessary. In addition, local variables cannot be modified using Access Control modifiers such as private. Therefore, the access control permission modifier cannot be added.

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.