In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "what are the common problems in Java programming". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Problem 1: the compiler cannot find the class.
Solution:
Make sure you have imported the class or its package.
If the CLASSPATH environment variable is set, reset it.
Make sure the spelling of the class name is the same as defined, and pay attention to the case problem.
If the classes are in the package, make sure they are in the correct subdirectory.
At the same time, some programmers use different names for classes from .java file names. Make sure you use the class name instead of the file name. In fact, this error does not occur by making the class name the same as the file name.
Problem 2: the annotator cannot find one of the classes
Solution:
Make sure you specify the class name and not the file name of the class.
If the CLASSPATH environment variable is set, reset it.
If the classes are in the package, make sure they are in the correct subdirectory.
Make sure you call the annotator from the same directory as the .class file.
Question 3: the program doesn't work? What on earth went wrong?
Here are some common mistakes made by newcomers to JAVA. Note the following:
Have you forgotten to use break in every case statement in your switch statement?
Do you use the assignment operator = when you should use the comparison symbol =?
Is the termination condition correct in the loop statement? Make sure you don't stop the cycle too early or too late. That is, make sure you use it correctly.
< 或或 >= an operator.
Remember that the index of the array starts at 0, so the loop of the array should be:
For (int I = 0; I
< array.length; i++) . . . 你是否在比较浮点型数使用了==?大于号和小于号(>And
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.