Or just "main(args)". That's an example of "direct recursion".
If you have two methods that call one another -like in your example-, that's called "indirect recursion".
Ray Dawson
Ranch Hand
Joined: Sep 16, 2011
Posts: 75
posted
0
Zandis Murāns wrote:Like this:
It worked :jumpingjoy:
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
4
posted
0
And don't try mixing static and instance methods like that. The compiler won't like it.
Ray Dawson
Ranch Hand
Joined: Sep 16, 2011
Posts: 75
posted
0
Campbell Ritchie wrote:And don't try mixing static and instance methods like that. The compiler won't like it.
Yeah that's one thing which I did try to avoid.
In my main program, I have about 5000 lines of code, with say about 30 functions. All are static & all variables are public & static.
I'm working on multiple threads right now, so you think having public static everywhere can make them thread-unsafe ?
Campbell Ritchie wrote:And don't try mixing static and instance methods like that. The compiler won't like it.
Yeah that's one thing which I did try to avoid.
In my main program, I have about 5000 lines of code, with say about 30 functions. All are static & all variables are public & static.
I'm working on multiple threads right now, so you think having public static everywhere can make them thread-unsafe ?
Then you should step away from the keyboard and go find yourself another language... ;)
You are not really doing it in an object oriented way. Normally, I allow main-containing classes to be about 3-14 lines. The rest should be taken care of by other instances of other classes.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
4
posted
0
Ove Lindström wrote: . . . find yourself another language... . . . .
If you are doing functional programming, there are several suitable languages, eg Oz, Prolog, LISP, ML. But not Java™.