Coding problems in Java Engineering

Source: Internet
Author: User

An example of an array application in "Crazy Java Handout" arrays, NUM2RMB, using nodepad++ editing, appears:

Encoding GBK non-mapped characters

Try using javac-encoding utf-8 Numtest.java

Error message: Illegal character: ' \UFF1B '

No fruit ...

Overall, the problem should be that the default code for the JDK is inconsistent with the encoding of the Java file being written.

Javac the-encoding parameter is omitted, the encoding of the operating system is automatically used. CMD input chcp Get the activity code of 936, indicating that the operating system default encoding method is GBK.

That is, the effect of Javac Filename.java is equivalent to javac-encoding GBK Filename.java

Change the file to the same encoding format as sample, sample can compile normally, and the Java file that I wrote has been error ...

Still failed to solve the problem ...

And there is a problem, after the direct paste copy, the public class of the declaration always prompt the class is common to add the declaration, and then remove the general, the compilation since it passed. Online said EditPlus Add public is superfluous, did not understand this sentence is what mean ...

Coding problems in Java Engineering

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.