I would try to see if the code really wants to be refactored. Will calls to calc() always use getNum() as its parameter? If so, your code might be better looking like this: int i = StaticClass.calc(); where the use of num is subsumed in the calc method. This may make the code a bit clearer/cleaner. Otherwise, I don't see a conflict in calling two static methods.
Originally posted by Paul Keohan: Trying to phrase this correctly!!! Is it considered poor coding to call two methods of the same static class within one call. For example.
Could there be a conflict in the way getNum() returns a value to be used by calc()?
Thanks! Paul
You mean static methods of a class, right? Only inner classes can be static.
Well, only nested classes can be static. Only non-static classes can be inner classes. But yes, Paul must be talking about static methods, not static classes.
Originally posted by Jim Yingst: Well, only nested classes can be static. Only non-static classes can be inner classes. But yes, Paul must be talking about static methods, not static classes.
Yes, I was talking about static methods. Thanks for everyone's input.
Anderson gave himself the promotion. So I gave myself this tiny ad: