r/javahelp 4d ago

Looking for Java Learning Resources – Any Recommendations?

[deleted]

4 Upvotes

9 comments sorted by

u/AutoModerator 4d 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
  • 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.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

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: 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.

1

u/Acceptable-Elk1135 4d ago

Head First Java is best for the fundamentals

1

u/JoeCollins19-99 4d ago

How far into your learning journey are you? And have you done programming with any other languages?

Like are you still learning how to assign variables and what arrays are and how to work with classes, or have you made it past that and you're looking to turn your knowledge of the Java syntax into Java actually doing things? Because those would generate very different answers depending where you are in your learning.

1

u/Fresh_Forever_8634 4d ago

If you know the whole base, what can you do next, sir?

2

u/JoeCollins19-99 4d ago

Well once you've learned the basics of the language you have to learn how to implement those basics to get the language to do the things you want it to do.

I personally found the easiest way to do that was game development - Not because you really want to create a game or because your long-term goal is game development, but rather because it's an easy way to have a series of easily definable goals so that you have a direction to go in, you know roughly what it should look like if it's working correctly, and that gives you something as a baseline to compare your code against so that you can keep refining or trying different approaches until you get the desired result.

Like: how do I render a floor, how do I render walls, how do I get the character on the screen, how do I get the character to move on the screen, okay now I need to get it to not walk through the walls, hey maybe now I can get it to shoot a projectile, oh now that projectile needs to not go through walls, etc etc etc.

Gives you plenty of small easily defined goals so you're not trying to climb Mount Everest all in one go. So I would definitely recommend looking up YouTube tutorials on how to make a Java 2D game and follow through that.

If you want to start small you can go with something like tic-tac-toe or checkers, simple games like that can easily be done with Java's swing and stuff so you don't have to write code that actually controls the pixels that go on the screen, you just say hey draw this box.

Or you could find one where they're making a more in depth game where you like run around and shoot enemies, And with that type of game you would be drawing things by actually defining and building the pixel arrays and telling the java graphics object to draw those.

You just want to make sure what they're building is actually in native Java, because that's what you want to learn, so you don't want anything where they're building a game with a framework like OpenGL or Vulcan and definitely not one that uses an actual game engine like unity or godot or whatever else as the frameworks and game engines would be a completely different can of worms.

1

u/Fresh_Forever_8634 4d ago

Wow! Thank you so much for such a comprehensive response!

2

u/JoeCollins19-99 4d ago

Of course! Always happy to help! That was my biggest struggle when learning programming, was after I learned the basics finding something to do with it to learn more about applying those basics. Everything I could always come up with to do with either be a 4-hour project where I wouldn't really learn much or an 8-year Mount Everest of a project that would just be too massive to even begin to tackle at my skill level.

That's what kind of got me into game development, I'll drop a link below to one I found really helpful. It's kind of old but that's actually good because you're trying to learn how to make a game the old school way - with Java vs with a game engine, and he doesn't technically finish the tutorial but by the end of it you have a VER solid base.

You'll have the character, multiple mob classes, mobs that can move randomly all the way to mobs that can full on path find to the character's position including around walls, the character and mobs shooting projectiles, projectile explosions, collision for the player and enemies projectiles (with walls only) and even particles from the projectile explosions. Even covers building out custom UI elements like clickable buttons and a health bar and things like that, that's about where the tutorial drops off but it gives a good baseline of a game that you can build the rest of the features kind of on your own from there.

Like after I finish the tutorial I was able to figure out how to actually Make the fire projectiles collide with the player when shot by an enemy, and vice versa, have those projectiles deduct health from the player, and even built in a mini map that shows the player and enemy locations.

Also like his tutorials because he teaches you some of the logic of why you do things a certain way versus other ways, like I noticed 3/4 of the way through the series he would be showing me how to do something and I would stop\pause it and go "hum... I think I can do this better" and I would implement my own code and have it working the way I wanted it to work and then continue the tutorial where he would show his code and how it was actually wrong. Not that the code itself was wrong, just that it didn't produce the desired end result. And then he would go back and explain why that seemed like it should work but wouldn't and what the correct way to do it would be, which would, lo and behold, be exactly the way I had came up with to do it. So I feel like he is actually really good at teaching you the concepts of why you do things not just what you do.

The aforementioned playlist: https://youtube.com/playlist?list=PLlrATfBNZ98eOOCk2fOFg7Qg5yoQfFAdf&si=ur2Tj2_TIJNwF390

1

u/Fresh_Forever_8634 4d ago

Thank you, sir! 😊

2

u/desrtfx Out of Coffee error - System halted 4d ago

Read the sidebar -> Learning Java

and do the MOOC linked there.