dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Java Language
Expertise: Beginner
Oct 17, 2000

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Static Methods

Question:
What is the purpose of static methods in Java?

Answer:
Static methods can be invoked without an instance of an object. They provide the ability to execute methods in a manner similar to C functions. Utility functions that do not depend on the internal state of a class instance are often implemented as static methods. Application global factory methods are also often implemented as static methods, although it is probably more appropriate to implement them as non-static methods in a factory object for which the application retains a static reference.

Examples of static methods in the Java core APIs include "Thread.sleep()" and all of the methods in "java.lang.System."

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date