Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What problems should beginners of Java pay attention to?

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "what problems should Java beginners pay attention to". In daily operation, I believe many people have doubts about what problems Java beginners should pay attention to. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what problems should Java beginners pay attention to?" Next, please follow the editor to study!

1. Pay attention to indentation and blank lines, each line should not exceed 80 characters

2. The name should be descriptive, but not too long. Short names are not recommended when remote.

3. A special name (such as pi) should be defined as final

4. Don't let a class be too big, and don't let a method be too big (try not to exceed 50 lines).

5. Try to avoid calling other languages in the code (such as C, php, etc.)

6. Choose a relatively optimal algorithm

7. Capitalize the first letter of the class name

8. the first letter of the method name is lowercase, then the first letter of each word is capitalized, and the method is named using a verb or verb-object phrase.

9. If you are not sure why a variable is declared, it should be temporarily declared as private

10. the first letter of the variable name is lowercase, then the first letter of each word is capitalized, do not use an underscore

11. Constants are generally all uppercase and can be underlined

12. Leave a space between any symbol and name

13. Have notes, but don't write nonsense

14. Variable names that change frequently can ignore description and convention:

I, j, k usually represent integers

R, t, u, v, w usually represent real numbers

X, y, z are usually juxtaposed or represent floating point numbers

S, S1, S2, usually represents a string

C, ch usually stands for characters

F, file usually stands for files

Tmp, temp usually represents a temporary variable

Ctr, cnt, cntr generally represent counters (if the variables I, j, k have been used)

Dummy, foo, bar generally represent dumb variables

Args is the primary parameter name of main-method

At this point, the study of "what problems should beginners of Java pay attention to" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report