Java errors Summary

Source: Internet
Author: User

Error! Various Errors!

Chairman Mao said that it is not terrible to have an error, but it must be changed! This article describes the various errors encountered by the side dishes for personal reflection only.

Error 1: the most stupid mistake-spelling mistake

When reading the thread, I copied a routine in the book. The calendar class is used in the program. When I finish writing the program, an error is always reported, indicating that it does not exist. I did it over and over again, but it still does not exist. What's wrong! I simply did not check it again. When I read the book the next day, I saw the word again and suddenly thought that I may have misspelled it. Go back and check the program! I wrote it as calender. God!

Error 2: Let's look at the figure. It's a long and big mistake.

I am dizzy when I see it. What's wrong? It's all in English! I am not good at English, right? Hey, who made dos, Java ...... Are they not invented by the Chinese? What seems to be an exception, and it seems to be related to the class. I ran back to see it. That's right. No error at all. Dizzy. I wrote the command wrong and should not add. java.

Error 3: The entry function is not main.

Like! It is exactly the same, but it does not contain. java. It should not be a command error. Well, let's look at the program. This is indeed a program error. I wrote main as mian. That's right. The main method is the entry of the Java program and cannot be changed.

Error 4: The file name and class name are different.

The error message is as follows: Modify the class name modified by public or modify the saved file name.

Error 5: HTML file of Applet

It is warned that the <APPLET> flag requires the height or width attribute. There are two possibilities at this time. One is that the program does not define the height and width, and the other is that the definition is wrong. There are several errors: A. The value is not caused by quotation marks. B. misspelling of width and height.

In another case, when you run the program, there is no response, even though no error is reported during compilation. At this time, it should be noted that the. html file is incorrect.

Post a prototype:

<HTML>
<Head>
<Title> little five </title>
</Head>
<Body>
<APPLET code = "clock. Class", width = "100", Height = "30">
</APPLET>
</Body>
</Html>

I have forgotten to write </APPLET> many times.

Error 5: incompatible type (see figure)

The error has already been pointed out. The jlabel object uses the jframe constructor. Too stupid

 

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.