IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Java
Search Java Group:

Advanced
-Collapse +Expand Java To/From
To/FromCODEGuides
-Collapse +Expand Java Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingJava   Print This     
 
Java Static Members (static)
 
Posted 16 years ago on 10/31/2008 and updated 1/19/2009
Java Code Snippet:
 A flashcard from our Java Flashcards Library
 A code snippet from our Java Code Snippets Page

KB101478

General Info: Static Class / Static Member

A static member is a member you can have access to without instantiating the class into an object. For example, you can read and write static properties and call static methods without ever creating the class. Static members are also called class members (class methods, class properties, etc.) since they belong to the class and not to a specific object. A static class is a class that contains only static members. In the UML, these classes are described as utility classes.

Languages Focus: Static Member

Languages that support static members usually at least support static member fields (the data). Some languages also support static methods, properties, etc. in which case the class member is held in memory at one location and shared with all objects. Finally, some languages support static classes which usually means the compiler will make sure a static class contains only static members.

Java Static Members

When calling a static method from within the same class, you don't need to specify the class name.

Syntax Example:
class MyUtils {
//Static method.
  public static void MyStaticMethod() {
}
}



Static Method / Static Class
A static method is a method you can call without instantiating the class. Also called a class method since it belongs to the class and not to a specific object created from the class. A static class is a class that contains only static members. In the UML, these classes are described as utility classes.

More Info

Definition:  Static Class / Static Member

Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

I really appreciate the information and advice you have shared with us. Many thanks for sharing this useful and valuable information.   H‑E‑B Partner Services

Posted 18 months ago

Comment 2 of 2

Thanks for share this information !!!!   https://www.my-indigocard.com

Posted 6 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P161A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile

 KB Article #101478 Counter
9654
Since 10/31/2008
Sales Website: www.prestwood.com Or visit our legacy sales site: 
legacy.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]