4

Quick tip of the day: While learning Java, avoid defining anything as static

 1 year ago
source link: https://www.kevinhooke.com/2022/12/02/quick-tip-of-the-day-while-learning-java-avoid-defining-anything-as-static/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Quick tip of the day: While learning Java, avoid defining anything as static

If you’re just starting out and learning Java, avoid the temptation of defining anything as static until you understand what this modifier does and why/when you need to use it: no static Class properties, no static methods.

The only use of static while you’re starting out is in your main method. You don’t need it anywhere else. You’ll avoid a lot of unexpected and unexplainable behavior as a result.

CategoriesKev's BlogTagsjava, programming, tip of the day

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Website

Save my name, email, and website in this browser for the next time I comment.

Notify me of follow-up comments by email.

Notify me of new posts by email.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK