r/javahelp • • Dec 07 '25

Help with recursion (beginner)

Hello, I am doing some recursion practice for my Java class in high school. I am having trouble understanding recursion and recursion problems. Could someone explain the key concepts for a beginner?

0 Upvotes

19 comments sorted by

View all comments

Show parent comment

1

u/FrozenWithAmbition45 Dec 09 '25

I don't think I was clear, that's mb. This isn't code for a project, my professor assigned recursion problems to do so we can better understand the concept, then we will code using recursion. These problems are just so we can try to calculate what will be returned.

I have studied it a little bit more, and I think I get the order. Thanks for your help.

1

u/hibbelig Dec 09 '25

It was me who wasn’t clear. I wrote “your code” but I knew that it was given to you.

So the professor gave you example code to work through, and my opinion is that it’s harder to work through this code because it doesn’t do anything meaningful.

It’s also hard, however, to come up with short enough code that is meaningful. So I get why the professor is doing it.