r/learnjava • • Sep 23 '24

Java need help

Two weeks ago, I started studying Java at school, learning basic concepts like switch, for, do while, while, Scanner, and modulo. The problem is that when I try to solve a new exercise, I’m not able to do it because I don’t clearly understand how to solve the logic behind it. I either need ChatGPT’s help or for my teacher to break it down for me. the guy sitting in front of me does all the exercises in about 10 minutes, while it takes me 10 minutes just to finish one, and I still make logical mistakes (not syntax errors) but rather mathematical ones. How can I improve my logic or/and reasoning In Java? Btw I know that the guy In front did code before and I am aware that it is a matter of time till I fully understand and be able to solve independently exercices without any help.

1 Upvotes

15 comments sorted by

•

u/AutoModerator Sep 23 '24

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.

12

u/MissionInfluence3896 Sep 23 '24

You have to go through basic exercises again and again and again and study code snippets and methods from many places to understand patterns

-3

u/Then_Use_4152 Sep 23 '24

Thanks man I just discovered recently w3schools and it been really helpful

5

u/jewbarrymore_ Sep 23 '24

the worst resource you could pick

1

u/8dot30662386292pow2 Sep 24 '24 edited Sep 25 '24

No it's not. Geeksforgeeks is.

(edit: why downvote? w3 IS one of the worst, but geeksforgeeks is definitely way more horrible)

2

u/MissionInfluence3896 Sep 23 '24

And really dont chatgpt the way out of it Even tho it will make you pass on easy exercises. As projects grow with many classes and methods reffering to each other, the chat wont have any grasp on What you do and you’ll be left alone with not more skills.

Grind the basics until it clicks. Some people are naturally better at problem solving, but dont get discouraged by comparing yourself to the top dogs. Focus on your learning and focus on your work.

2

u/hrm Sep 24 '24

W3schools is quite unreliable, some content is good. Lots is bad. Baeldung is a much better source for java content.

1

u/FamiliarCondition466 Sep 23 '24

Drop me a dm , I can coach you whenever you hit a issue. As I would help you inderstand the kogic ratger than giving you the solution . That is the best way to learn

2

u/AutoModerator Sep 23 '24

It seems that you are looking for resources for learning Java.

In our sidebar ("About" on mobile), we have a section "Free Tutorials" where we list the most commonly recommended courses.

To make it easier for you, the recommendations are posted right here:

Also, don't forget to look at:

If you are looking for learning resources for Data Structures and Algorithms, look into:

"Algorithms" by Robert Sedgewick and Kevin Wayne - Princeton University

Your post remains visible. There is nothing you need to do.

I am a bot and this message was triggered by keywords like "learn", "learning", "course" in the title of your post.

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

2

u/YacineLim Sep 23 '24

The answers to your question are in your question, my friend, the first one is: that you started learning Java two weeks ago, my friend you don't get fast algorithmic logic in just two weeks, second it is a matter of time with the necessary practice you will be able to solve problems rapidly, and you will improve your logic in algorithms not in java, Java is a syntax.

Good luck.

2

u/gul3um Sep 24 '24

W3schools + more practice! 😊 Small progress is still progress, just train your mind on basic exercises until you reach the expertise level.

1

u/theswissnightowl Sep 23 '24

I suggest to use ChatGPT not to solve an issue, or at least not only. Let it explain in detail how things work. If it shows you some code let it explain all the fine details. Ask whatever you need to know. Helps a lot. I’m in software development for twelve years now and doing exactly the same

1

u/failedreality Sep 24 '24

This sounds like a mirror image of my struggles as well. Like I understand loops and arrays (that's where we're at right now) but as soon as we have like 10 programs to write it's like my brain melts and I don't understand logically where to start. So I completely understand where you're coming from.

-3

u/iAmazingDreamer Sep 23 '24

Dont waste your time if you dont have logical skills. I learned programming since 2019, still I coudnt fathom the logic needed to solve problems.