wood burning stoves*
The moose likes Beginning Java and the fly likes static  and non static methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static  and non static methods" Watch "static  and non static methods" New topic

static and non static methods

prabhakar p

Joined: Jan 11, 2001
Posts: 5
what is static and non static ?
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
This is really more of a General Java question than a Swing question. I'm moving this to the Java in General Beginner forum.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

static variables and methods belong to the class as a whole, whereas non-static variables and methods belong to specific objects created from that class. i.e. All objects created from a class share the exact same static methods and variables.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
"prabhakar p",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
subject: static and non static methods
Similar Threads
static and non static methods
about protected n static
What is "non-static method" vs "static context" ?
JavaCaps mock 1 Q:39