r/learnjava • • 2d ago

Best books for learning java in 2026

25 Upvotes

I'm looking for a Java book that covers everything from beginner to advanced levels.

I'd prefer a book that explains concepts in simple, easy-to-understand language, with clear examples and practical exercises.

If you had to recommend just one book that provides a comprehensive understanding of Java, which one would you suggest?

Thanks!


r/learnjava • • 2d ago

Building a custom Java data structure library for my game, would like feedback.

2 Upvotes

I recently released JArray, a Java data structure library I've been working on.

The goal was to build something that combines dynamic sizing, specialized primitive storage, mixed data types, and multidimensional array functionality because I thought it might help me with my game-development, things like inventory, maps, and parsing save files.

it currently uses a whole bunch of primitive arrays, and metadata array to hold values. but i don't know if its better to use a single object array.

I'd appreciate feedback on the API design, storage architecture, and features that would make the library more useful, also any questions about the library.

here's the GitHub to the project. hopefully it doesn't get flagged as promotion: https://github.com/AJ-1-code/JArray


r/learnjava • • 3d ago

Java is Fantastic especially if you try it and stopped listening to internet memes.

87 Upvotes

Have a fantastic programming life 😎💯😁


r/learnjava • • 3d ago

How to remember the java and revise in 1 month

5 Upvotes

Hey I've been taking training in Java for 6 months. But I have forgotten everything, I do not remember the basic level programming and questions(Armstrong, Palindrome, Stars, Patterns).

Now we are in the spring boot phase and the training is to be completed in 1 and half month.

How to revise java and how to remember everything in the 1 month?

Help or give the tips.


r/learnjava • • 2d ago

been learning on mooc.fi, is so far on part 2 of Java 1, is there a better way for this?

0 Upvotes
import java.util.Scanner;
class Main {
    public static void main(String[] args) {
       //  System.out.println("Try clicking the Run button.");
        Scanner scanner = new Scanner(System.in);

        System.out.println("What is your name?");
        String name = scanner.nextLine();
        System.out.println("Hello " + name + " ,lets begin using this calculator ");
                
        System.out.print("Enter your first number:");
        int first = Integer.valueOf(scanner.nextLine());
        
        System.out.print("Enter your second number:");
        int second = Integer.valueOf(scanner.nextLine());

        System.out.println("would you like to add, subtract, multiply or divide these numbers?");
            String math = scanner.nextLine();
        if (math.equals("add")) {
            System.out.println("Result: " + (first + second));
        }

        if (math.equals("subtract")) {
            System.out.println("Result: " + (first - second));
        }

        if (math.equals("multiply")) {
            System.out.println("Result: " + (first * second));
        }

        if (math.equals("divide")) {
            System.out.println("Result: " + (first / second));
        }     
    }
}

r/learnjava • • 3d ago

Study vs AI

0 Upvotes

Hello community! I'm a sixth-semester information systems student, and I really like keys, but I still have a lot to learn. In fact, when I learned how to create a Spring application, I was so confused. My professor tells me to learn so I can correct the AI's mistakes when I notice its excesses and hallucinations, but how can I learn if it seems we won't need to write code anymore, If everything will be automated?! Another point is that I still don't know Python; I know it's an easier language and you can do much more with it than with Java.I don't live in the US, but I want to be good at this, I want to learn and develop projects, automate tasks, including people, and get a good job. I'd like to know from you, what did you do to reach that level? How did you do it? Did you use AI to learn?


r/learnjava • • 5d ago

Recommend resources to learn Java in big 2026

10 Upvotes

Hey fellas, I am a 3rd year CSE student. I wanted to learn Java as my primary programming language.

I have wasted a lot of my time in Procrastination and tech stack hopping. But now, I have decided to lock in to java as my programming language for software engineering and DSA as my placements will start in about 7-8 months.

My background:-

I have some previous programming experience with c, python, JS, HTML, CSS. I also had a subject named OOP in Java in my previous semester, I know a few things from it, but mostly I studied it for the sake of Exams only. I have made some vibe coded projects in hackathons too, all of them are web applications.

So I wanted to ask what are some good resources in 2026 to learn Java?

I want to learn Java and then later on get into enterprise tech, backend and microservices. I might switch to cloud and Devops later but it's too far to think about now.

My known resources:-

(1) University of Helsinki MOOC course.

(2) Telsuko 63-hour video

Are these resources Good enough for the start? If yes, then Can also list what these lack or don't cover?

Thank you for your answer in advance.

Edit:- Removed the 3rd resource, (3) Telsuko's older Java playlist as it's covered in the resource (2).


r/learnjava • • 4d ago

Ubuntu apparently doesn't support icons but need confirmation

0 Upvotes

so I tried this code package test.GUI;

package test.GUI;

import static utility.Cout.coutln;

import javax.swing.ImageIcon;

import javax.swing.JFrame;

public class Main{

public static void main(String[] args){

JFrame frame = new JFrame("this is an window:DD");

frame.setVisible(true);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.setSize(420, 420);

ImageIcon image = new ImageIcon("kuroicon.png");

frame.setIconImage(image.getImage());

}

}

but it seems that the window's icon isn't loading, which I believe is an OS restriction because Ubuntu only loads it's icons from .desktop files and MacOS doesn't support icons on windows at all, can anyone confirm me that is the cause? or there is another thing I am misurdentanding


r/learnjava • • 6d ago

How do you guys manage to understand programming concepts?

33 Upvotes

Seriously, how do you guys manage to understand programming concepts?

I'm currently attending an academy where we learn independently by working on small projects that cover OOP concepts (inheritance, polymorphism, collections, exceptions, testing, generics, enums, etc.).

I feel like none of it is actually sinking in, and honestly, it's starting to worry me.

I'm learning Java and currently studying interfaces and how to connect them with other classes. After that, I'm supposed to move on to design patterns, since some of them use these kinds of structures. But I just can't seem to get it. Seriously.

I eat well, get enough sleep, exercise regularly, but sometimes it feels like my brain just isn't working properly. Everything is taking me way too long to process. I'm even starting to wonder whether programming just isn't for me and if I'm forcing myself into something I'm not cut out for.

I can spend hours (sometimes in one sitting, sometimes spread throughout the day) trying to understand a concept, and still not get anywhere.

I watch YouTube tutorials, ask AI to explain things in different ways, try to approach the topic from different angles... and even then, nothing seems to click.

How do you deal with this? Is this normal when learning programming, or am I doing something wrong? I also struggle with reading documentation. It's not that I don't want to read it, but when I do, it's like I'm just looking at words without actually processing what they mean. I read the sentences, but my brain doesn't seem to absorb any of the information. It's really frustrating.


r/learnjava • • 6d ago

Rate my first java project

9 Upvotes

https://github.com/jacmaw-byte/NewLRIA

I started programming a couple years ago by learning python and have learnt c, c++ for the past year. But after finding out the sixth form I'm going to teaches Java; I decided to learn it. Please give constructive feedback on how I can improve my code.


r/learnjava • • 7d ago

How do I lock in?

3 Upvotes

Had my first Java quiz and my professor failed me for a reason that was completely arbitrary (he doesn't like camelcase which he told no one about until that second) and said I wasn't that good of a programmer. I'll give him that; I'm self taught and have no programming experience in the field. How do I lock in so he never catches me off guard like that again?


r/learnjava • • 7d ago

Feedback for my first "Complete" API REST

4 Upvotes

Hello i want to share my first "complete" api rest made in java with spring boot, not so complete, theres still a lot of stuff i want to add in the future i also want to make more complex and bigger projects, its a social media api something like reddit, with posts, comments and users, security etc, i want to get some feedback and suggestions on what to add or make better, its my first time completing an api so im not an expert in this and probably theres is somthing i did not make perfect but thats part of the learning process i guess, thx and sorry if my english is wrong

https://github.com/blasman2002/Backend-API-REST-JWT


r/learnjava • • 10d ago

Looking for a Udemy 1Z0-830 (Java 21) practice test that matches Enthuware's style/difficulty?

4 Upvotes

​Hey everyone, I’m preparing for the OCP Java 21 Developer exam (1Z0-830) and looking for Udemy mock test recommendations.

​I know Enthuware is considered the gold standard, but the 6-month license restriction and having to use either desktop software or an awkward mobile web mode doesn't fit my study workflow. I prefer Udemy's platform features, offline mobile app, and lifetime access.

​However, there are so many 1Z0-830 practice test courses on Udemy that it's tough to separate the low-quality dump questions from the good ones.

​Which practice test set on Udemy comes closest to Enthuware in terms of question rigor, trickiness, and detailed explanations? Would love to hear from anyone who has taken both or passed the exam using Udemy!


r/learnjava • • 11d ago

Do developers all just remember program in there head or use documentations to write codes?

17 Upvotes

Till now I thought that I have to remember everything I learn but one of my friends said that they use documentation to write codes since remembering everything is not possible. If so what am I suppose to remember and what kind of documentation should I read. What is the process of learning JAVA ? I finished making a simple crud operation program. From here on what should I start learning? What should I focus on? Help please


r/learnjava • • 11d ago

From a java beginner to java devs

5 Upvotes

I am learning java. I made a simple crud operation. I heard from alot of experienced people that I should make projects as I learn something and it help. What project should I work on? Something beginner friendly and that I will learn as I make the project


r/learnjava • • 11d ago

Problem statement for revision from MOOC FI PART 1 TO 6

0 Upvotes

I'M looking to revise Java from part 1 to 6 as i have taken long break due to some issue but im looking forward to re start my journey again so please provide the list of question (not all) that can be helpful for me to solve them so i can brush up my concept and start from part 7....

Important note: I did revise all the concept and im only looking for important problem that by solving them it can confirm me that i have regain my knowledge back


r/learnjava • • 12d ago

Library vs API (Java ☕️)

10 Upvotes

Hey Everyone!

I need some help as I am Confused in Libraries and API like what is the difference in between them, where to implement what, and recommend me some resources where I can Clearly understand these two.

Thank you all in Advance.


r/learnjava • • 13d ago

Swing help. Image gets distorted when partially outside window.

2 Upvotes

I have a JPanel class that draws an image on screen with camera panning. The camera is zoomed in. The image being drawn is a 16x16 dirt.

When the image is entirely inside the window, it looks fine. When partially outside the window, it distorts and makes the image narrower to fit it inside the window. Eventually it snaps to the next pixel.

I have a video showing the problem, but this subreddit doesn't allow videos in posts. You should be able to see it by running the java code with any image of your choice, and panning the camera such that the image is at the edges of the window.

Does anyone know why this happens and how to fix it?

I'm using:
MacBook Air M1
Java 25
IntelliJ

The entire class is below.

Edit: Solved. The issue seems to only affect Mac. Running with java -Dsun.java2d.metal=false CompiledClass fixes the problem.

public class CameraPanel extends JPanel{
    public static void main(String[] args) throws IOException{
        JFrame frame = new JFrame("Camera");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new CameraPanel());
        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }

    private double cameraX, cameraY;
    private double zoom = 10.0;
    private Point lastMousePosition;
    private BufferedImage image = ImageIO.read(new File("src/test/resources/dirt.png"));

    public CameraPanel() throws IOException{
        addMouseListener(new MouseAdapter(){
            public void mousePressed(MouseEvent e){
                lastMousePosition = e.getPoint();
            }
            public void mouseReleased(MouseEvent e){
                lastMousePosition = null;
            }
        });
        addMouseMotionListener(new MouseMotionAdapter(){
            public void mouseDragged(MouseEvent e){
                if(lastMousePosition == null){
                    return;
                }
                cameraX += e.getX() - lastMousePosition.x;
                cameraY += e.getY() - lastMousePosition.y;

                lastMousePosition = e.getPoint();
                repaint();
            }
        });
    }

    
    protected void paintComponent(Graphics g){
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        g2.setRenderingHint(
                RenderingHints.KEY_INTERPOLATION,
                RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
        );

        AffineTransform transform = new AffineTransform();
        transform.translate(cameraX, cameraY);
        transform.scale(zoom, zoom);

        g2.drawImage(image, transform, null);
    }
}

r/learnjava • • 14d ago

learning resources

5 Upvotes

learning sources

which is the best book that i should learn spring boot from? Learning Spring Boot 4, Fourth Edition ? or Spring Starts Here ?


r/learnjava • • 15d ago

Built a small project called SwiftCache

4 Upvotes

I've been learning about caching systems and decided to build my own in-memory caching library in Java.

It supports different eviction strategies (LRU, LFU, FIFO, Random), TTL, read/write policies, and annotation-based caching.

This was primarily a learning project, and I'd really appreciate any feedback or suggestions on how I could improve it.

GitHub: https://github.com/saahilmahato/SwiftCache

Thanks for taking a look!


r/learnjava • • 15d ago

HCL Technical Interview for Digital Engineer (JAVA) role

0 Upvotes

I'm having HCLTech in-person Technical interview for the Digital Engineer (JAVA) role so what all things should i focus on and how should i prepare for it also my resume is having MERN Stack project and role is JAVA Full Stack and i have no knowledge of Springboot, react and all please help me and guide me how to prepare so that i can crack this interview successfully...


r/learnjava • • 15d ago

How to get it to click?

2 Upvotes

I’m sure this is a relatively common post here but it’s still a problem for me. I’m taking APCSA which is obviously about Java and I’m having an incredibly hard time understanding anything at all. I get all the individual components like substring and indexOf and whatnot but when it comes to putting anything together at all in classes or getters and setters or methods or anything at all I’m just so lost. Does anyone have any tips to start understanding how it all works together because my grade is struggling bad and I need to do well this semester?


r/learnjava • • 16d ago

OOP DESIGN

14 Upvotes

I've been learning Java for about a month now. So far I've covered OOP principles, Java Collections, and I'm planning to dive deeper into exception handling next.

However, one area where I still struggle is OOP design and structuring. I understand concepts like inheritance, encapsulation, abstraction, and polymorphism, but when it comes to applying them in actual projects, I often find myself struggling to distribute them properly among classes.

No matter how many classes I create to separate different parts of the logic, I eventually end up with at least one class containing too many methods and responsibilities.

What are the best practices, concepts, or design principles I should study to improve my OOP design skills? How can I develop the ability to identify when a class is doing too much, decide when to create new classes, and structure a Java application in a clean, maintainable, and scalable way?


r/learnjava • • 17d ago

Book recommendations for Java developer

12 Upvotes

Hello everyone, I am java developer with around 2 years of experience. I want to improve myself more in Java. I found that Effective Java 3rd edition is a good book for my level. But it is kind of old. Also English is not my first language, and the book's language is a bit heavy for me. I am looking for alternatives to Effective Java book. Are there more recent books with a bit more simple language?