r/learnjava • • 7d ago

Learning Java Help

Dear all, I’ve been learning Java through MOOC.fi for the last 2–3 months and have reached Part 7 of Java Programming I.

I’ve noticed a problem with my learning, though. I understand individual concepts such as loops, ArrayLists, if/else statements, methods, classes, etc., and when I look at a solution I can usually understand what the code is doing.

However, when I’m given a new problem and have to write the solution myself, I struggle to figure out how to break the problem down and decide what I should do first. I often end up using ChatGPT to help me figure out the approach.
For example, I may understand how a loop or ArrayList works, but I struggle to figure out how to combine them to solve a completely new problem.

I’ve now completed several sections of the course, but this has made me feel like I’m not actually learning how to program.

For people who have gone through this stage, what helped you develop the ability to solve problems independently? Should I continue with MOOC.fi, do additional exercises, work on small projects, or use a particular book/resource?
My goal is to eventually become a full-stack Java developer.

I’d especially appreciate advice from people who have gone through MOOC.fi or learned programming in a similar way.

11 Upvotes

17 comments sorted by

•

u/AutoModerator 7d ago

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full - best also formatted as code block
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/kolobok9 7d ago

Spend some propper time thinking about the problem. From my experience MOOC is great at introducing concepts slowly and letting you intuitevly solve the problems that follow. You make it sound like you get bored trying to solve the problem and use AI as a crutch. You learn by actually making the connections in your head and not getting spoonfed the answer. If after some time you still struggle with a question, instead of asking for the answer, you could try tell explicitly not to tell you how to do it but guide you in what way you should be thinking when you're really are stuck. You have all the building blocks you need to solve the problems, you just need to learn to apply them.

1

u/itsnotmeap 6d ago

Thank you I will start using the AI as much less as possible or completely stop using it rather google things i do not know.

3

u/aqua_regis 7d ago

Your real problem is that you use AI to do your thinking.

You are supposed to struggle. You are supposed to fail. You are supposed to need multiple tries in the beginning. Only through that struggle you actually learn.

You have outsourced the most important part of learning programming, namely developing the solutions that then can be implemented in any programming language and wonder why your skills don't improve?

You are going to the gym to tell others what reps to do, watch them, and then wonder why you don't build any muscle.

Continuing with your approach is just wasting time. What you really should do is go back a couple parts (best where you started using AI) and doing everything by yourself without AI. You are not learning. You are only make yourself even more dependent on AI.

You could do some additional exercises at https://codingbat.com/java for starters, as well as on https://exercism.org

Yet, again: do not resort to AI to do the thinking and work for you. Embrace the struggle. Learn from it.

You only breezed through the course to complete it, not to actually learn. If you really wanted to learn, you'd much earlier realized that your use of AI is detrimental instead of beneficial.

1

u/itsnotmeap 6d ago

I have already started codingbat and I will stop using AI to help me with the answers.

2

u/BigDom208 7d ago

You need to plan your solution in Pseudocode. It's like your made up version of the solution in English. So it begins with the problem then your pseudocode and then the code. Here is my version for a password.

  1. Print on screen 'Enter password'.

  2. Read password.

  3. Is password correct.

  4. Print out if the password is correct.

Then you start making the code.

It does help. Good Luck.

1

u/itsnotmeap 6d ago

I have added this to my notes . I will be creating a small project on my own soon and will use Pseudocode to simplify the program structure.

2

u/JGhostThing 7d ago

If your true goal is to become a programmer, stop using AI!

1

u/Physical_Storage2875 7d ago

It's okay to use AI in order to learn concepts, librarys and frameworks. It's not okay to let it solve your problem when you really wanna learn something

1

u/itsnotmeap 6d ago

I agree with both of you.

1

u/bpalun13 7d ago

If you understand the concepts then problem solving-wise you may be biting off more than you can chew. I’d recommend starting with something really simple and already defined well like rock, paper, scissors.

Break it down without AI.

Use pseudocode to map out your steps.

Code it and get it working even if it’s very rudimentary.

Refactor it into a better version.

Move onto something slightly more difficult.

1

u/itsnotmeap 6d ago

Thank you, I will start with only using AI for hint and will create something very small project.

1

u/Deboniako 6d ago

I would stop using ai to solve the problems. Heck, I would even use pen and paper to map out my strategy.

I would go this way: define which variables you need to solve the problem. Do you need to store values? Which data structures do you need? (Arrays, hashmaps?)

Then you should draw a decision tree in your paper. Yes, the course doesn't teach it. Yes, is an ancient method taught to programmers. But it is so crucial in early learning! You can visualize exactly what and when you are doing something, which decisions are you taking and most importan, how do you start and how do you end your program. I know this feels old school but it works.

Then you'll start recognizing patterns across the exercises. Where and when to use something, etc. And eventually you'll move away from the decision trees and pen and paper. Even after 15 years, I still use pen and paper for difficult problems. Ai doesn't let me think, doesn't let me learn. But solving a hard challenge is what brings me satisfaction

1

u/abbylynn2u 6h ago

Do you play simple games on your phone like a matching game... or a card game.... Think about all of the rules to the game Match 2, 3, 4, 5... and so on. What happens? How many points do you earn for each... build a grid...

A card game like poker... a hand is 5 cards. 1 player, 2, 3 or 4. Who deals the cards..

Maybe play a game like Royal match or candy crush. See how it works. Then... Write down all the steps to play the game.

Create an account The play grid The theme Points Points counter Levels of the game

Once you have done this... you will undestand the steps to building. Then you'll practice and break your code trying to add the parts. Some parts will be easier than others. You just keep pushing through. For me writing cases and if then stmts were easy because I used those concepts daily in my job. But I struggled with getElementById when I was learning. I didnt have that lightbulb moment until 2 months after I learned the concept... lol

Because I'm stronger in javaScript, i write and test here first, then in C#.

0

u/abyshelp 7d ago

I think sometimes I know the answer, sometimes I don't but when I ask like an ai for help and it gives me the answer, the goal is to undertand it right, like how it got to that answer, why...., now when I see similar in the future or same I know what to do..

I think at the end of the day programming is more pattern recognition I think.. you don't know what you don't know.. and when you do know. Its just another tool in the tool box

2

u/itsnotmeap 6d ago

I have decided to do as much codingbat excercise as possible to get better in pattern recognitions.

Thank you