Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Software engineering question

Name: Anonymous 2006-04-02 22:43

And it's not about Java (necessarily).

Does it ever make sense to create a class that consists only of member functions and has no member variables? Basically, a class that exists just to physically group functions that share a purpose but don't neccessarily operate on the same set of data.

Name: Anonymous 2006-04-03 3:43

>>1
In Java, yes it does, provided you declare them all as static. In general any method that doesn't reference the members of an object should be static. Think of the Math class; you don't instantiate it, you just use its methods. Most languages allow some alternative form of modularisation, but in Java's (stupid) version of OO everything must be in a class, even things like the sin() function.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List