aspose file tools*
The moose likes Beginning Java and the fly likes What is Static ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What is Static ?" Watch "What is Static ?" New topic
Author

What is Static ?

Dhaval Gandhi
Greenhorn

Joined: Dec 03, 2000
Posts: 15
Hello,,
If we define any class with static keyword then what does it mean ?
Dhawal.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
A class can be defined as static only if it's an inner class. i.e. It's defined inside another class. A static nested class can refer to static methods and variables directly.
Bosun

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Dhaval Gandhi
Greenhorn

Joined: Dec 03, 2000
Posts: 15
IF WE DEFINE A CLASS WITHOUT STATIC WORD INSIDE ANOTHER CLASS THEN IT WILL MAKE IN DIFFERENCE. ?
DHAWAL.
Originally posted by Bosun Bello:
A class can be defined as static only if it's an inner class. i.e. It's defined inside another class. A static nested class can refer to static methods and variables directly.
Bosun

Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
A BIG difference. You need to read "Getting in touch with your Inner Class" in the Campfire Stories area of this site. Not only does it explain inner classes well (both static and not static) but it is fun to read!!!
http://javaranch.com/campfire/StoryInner.jsp


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
 
subject: What is Static ?