In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article focuses on "what are the common problems in JAVA programming?" friends who are interested may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn what are the common problems in JAVA programming.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.