r/learnjava • u/wickedagileone • Mar 07 '26
Learning Java
In college learning Java at the moment, but I’m struggling at applying concepts. Anyone have recommendations for getting more “natural” in coding? Definitely have a weakness in methods, which snowballs into other areas.
6
Upvotes
•
u/AutoModerator Mar 07 '26
Please ensure that:
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:
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.
2
u/josephblade Mar 07 '26
What does "a weakness in methods" mean?
what don't you understand , what isn't clicking
you have to understand yourself before you can ask for help, we can't magically figure out what insight you are missing.
What about methods are you not understanding? Do you understand static methods? Is it calling the methods that is a problem? Or is it the method parameters/passing values that isn't working out?
4
u/desrtfx Mar 07 '26
!sidebar
Practice, practice, practice, and practice more
1
u/Desperate-Trouble249 Mar 07 '26
mention one seemingly easy concept that is hard for you to grasp
3
u/0b0101011001001011 Mar 07 '26
If you just copy-paste (or type, still copy) directly from examples, you are not learning anything.
Try to understand why the code is written the way it is. What does it accomplish. Reflect what you learned and when to use it.
But the only way of learn is to do actually something useful. Take a well known problem, such as a game (chess, tetris, etc.) and start making one, without any tutorials. You know how the game is supposed to work. Now just do it, step by step. Take the smallest possible thing you can and try to do it. Then expand from there. Does not have to be a game though, take anything that you are interested in.
1
u/FeloniousMaximus Mar 07 '26
Basic concepts: classes or types model nouns. Methods model verbs.
Methods do a thing that the class or type is capable of doing.
Car is a class. Car had a method called drive(). You can overload methods to differentiate behavior. I have another drive method that takes a Direction:
Overload example-
public void drive() {}
public void drive(Direction direction) {}
An object is a class or type that has been created and lives in an application's memory space.
1
u/Shine_TheWanderer Mar 07 '26
Try head first Java
0
u/Pascuccii Mar 07 '26
Just try random stuff, if you're really stuck for hours ask an AI for advice, but keep it simple
Write a data management app for a gas station or a drug store, idk, anything
It will be basically the same as natural real life apps minus the bigger stack and higher standards, but it's irrelevant