This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes when to use of static class ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "when to use of static class ?" Watch "when to use of static class ?" New topic
Author

when to use of static class ?

Ayan Dutta
Ranch Hand

Joined: Oct 16, 2005
Posts: 94
Hi,
can anybody tell me the proper use of a static class .what can be the advantage ? first of all when it is required ? can anybody give me some real lif examples or use of it in Java Source cose itself ?
Regards,
Ayan
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1295
What do you mean by static class? What do you think the static keyword means?


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Mike Cole
Ranch Hand

Joined: Sep 25, 2006
Posts: 38
I dont know what a static class is.

Maybe you mean static functions and members?

If you have a function that does not to keep track of own internal variables and gets everything that it needs to fullfill the request via parameters then you can make it static...

For such functions theres no need to make an object.

(As far as i understand, so use this info with care )
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
static classes are special inner classes.

see here
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
i leave the link to the above article, but i find the described technique (seperate debugging code from live code) really weired, unusual and not recommendable.

:-)

jan
Ayan Dutta
Ranch Hand

Joined: Oct 16, 2005
Posts: 94
That's right, Jan . I was also going through that link and same thing came into my mind also
Any other example ?
Ayan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when to use of static class ?
 
Similar Threads
static inner class
Interface and Abstract Class
Instance and Static initializers
Abstract Factory Method
is it wrong to use "this" in static methods?