Java compile-time prompt requires an identifier

Source: Internet
Author: User

1. Description of the problem

2. Procedure source Code Analysis

3. Error cause Analysis

(1) To know in Java, the inside of a class cannot write code directly, the code can only be written inside the method , as the method body. Main is a very special method.
(2) The error is often not careful, resulting in curly braces {or} position forward or backward, or is more, may also be less curly braces, resulting in the statement is excluded from the method, directly in the class.
(3) It is also possible to forget the writing method directly in the class.
4. Workaround
Double-check the source code to correct the error that the statement appears directly in the class.

Java compile-time prompt requires an identifier

Related Article

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.