Originally posted by deepak mishra:
why cant we create objects of "only" methods ?
Joanne
You can. Just make all the methods static. Take a look at the Math class for an exanmple of this.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Originally posted by deepak mishra:
is that really possible ?
Originally posted by deepak mishra:
will my program work if i DO NOT put all of my STATIC methods in ANY class ?
Steve
Originally posted by Steve Luke:
Yes, not recommended, but possible.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Originally posted by deepak mishra:
is that really possible ?
will my program work if i DO NOT put all of my STATIC methods in ANY class ?
that way, there would be no need to put the main() method in any class, right ?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Originally posted by Rob Prime:
I disagree. I have several utility classes - just methods that perform pieces of code I would otherwise execute regularly. These methods do not belong to any other class, and retyping the code is a stupid thing to do. Ergo: utility class.
Steve
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Originally posted by Steve Luke:
You are confusing Class with Object.
Originally posted by deepak mishra:
did i get it right ??