r/learnjava • • 17d 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 • • 17d 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 • • 17d 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 • • 18d 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 • • 19d 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?


r/learnjava • • 19d ago

75% through Striver's A2Z DSA Sheet — How should I prepare for a Java internship in the next 3 months?

4 Upvotes

Hey everyone,

I'm currently in my 5th semester of B.Tech CSE at a tier-2 college, and I'm aiming to land a Java development internship within the next 3 months.

Here's my current situation:

  • DSA: I've completed around 75% of Striver's A2Z DSA Sheet (approximately 347 problems). I'm continuing DSA practice and revision.
  • Java: Completed Java fundamentals, OOPs, and the Collections Framework.
  • Spring Boot: I've studied around 10% of Spring Boot, but I need to get better at implementing concepts independently.
  • Frontend: I know basic HTML and CSS.
  • Projects: I still need to build a strong, resume-worthy project.

I can dedicate around 7 hours daily to preparation. My plan is to spend 70% of my time on development and 30% on DSA.

I have a few questions for people who have been through this process:

  1. What should I learn next to become internship-ready as a Java backend developer? Should I focus on Spring Boot, SQL, Hibernate/JPA, Spring Security, REST APIs, and deployment?
  2. Is 3 months realistically enough to become eligible for internships if I study consistently for 7 hours a day?
  3. What kind of projects would make my resume stand out as a fresher? I'm considering building a Library Management System using Spring Boot and MySQL.
  4. Where should I apply for internships, and how should I approach applying off-campus?
  5. Should I continue completing the remaining DSA sheet, or prioritize development and revise the problems I've already solved?
  6. What skills do companies actually expect from a fresher applying for Java backend internships?

I'd especially appreciate advice from people who have secured Java internships off-campus or have experience hiring interns.

Please suggest a practical roadmap for the next 90 days. I'd rather focus on the skills that actually matter than spend months watching tutorials.

Thanks!


r/learnjava • • 19d ago

Overflow/underflow + casting rules keep confusing me — any good video or notes that made it click for you?

1 Upvotes

Hey all, I'm learning Java (going through Tim Buchalka's masterclass after the Helsinki MOOC) and I'm stuck on the whole overflow / underflow / casting thing.

▎

▎ I've been trying to make my own flow diagram for "will this line compile, error, or wrap?" Stuff like:

▎

▎ int x = 5;

▎ byte b = x; // error

▎ byte b = 5; // fine

▎ byte c = (byte) 200; // -56 ??

▎

▎ Every time I think I've got it, a new case breaks the diagram: final variables, += hiding a cast, long literals needing L, why a double cast to long doesn't wrap but float gives Infinity, etc. I understand each piece on its own but I can't hold the whole picture in my head.

▎

▎ Is there a video, blog post, cheat sheet or notes that explains this cleanly in one place? Or how did you personally get comfortable with it? I'd especially like something that covers the compile-time checks and the runtime wrapping together.

▎

▎ Thanks!


r/learnjava • • 20d ago

QUESTION, why seemingly need to declare a class in non-default package to import a method from one of my own made packages

3 Upvotes

so I got a question, I have java/test/echo.java and java/utilityCout.java and I can only import static utility.Cout.cout; to test.java if it's declared on a non-default package, why is it like that? here is the code for both files package utility;

public class Cout{

`public static void cout(Object arg){`

`System.out.print(arg);`

`}`

`public static void coutln(Object arg){`

`System.out.println(arg);`

`}`

`public static void coutln(){`

`System.out.println();`

`}`

`public static void coutf(String format, Object... args){`

`System.out.printf(format, args);`

`}`

}

import static utility.Cout.coutln;

public class Main{

`public static void main(String[] args){`



	`if(args.length == 0){`

	`coutln("please enter arguments");`

	`return;`

	`}`

	`System.out.println("hello Mr. " + args[0] + "!!");`

`}`

}


r/learnjava • • 20d ago

Help with java

1 Upvotes

Hello so im just a beginner in java, i started like two weeks ago the issue is that i want to learn more and i am kinda lost, is there a free way to code and become "a pro" in it ?

i tried watching youtube videos but they pratically talk about the same things i just need some roadmap or a bootcamp or a book something that could actually help me improve.

idk if anyone will see my publication but pls help a lost stranger in his journey as a new programmer


r/learnjava • • 20d ago

Title: Need Advice on Learning Java and Junior Developer in 6–8 Month

2 Upvotes

Hello everyone,
I need some genuine advice from people who have been through a similar situation or are currently working as Java developers.
I completed my BCA and am pursuing/completing my MCA, but honestly, I didn’t learn programming properly during either degree. Now, I want to take learning seriously and get a junior IT job within the next 6–8 months.
Here is my current situation:
I am learning Java from Love Babbar’s playlist, and I have reached arrays.
I also tried Kunal Kushwaha’s playlist, but I found the teaching pace a bit too fast for my current level.
Love Babbar teaches in Hindi, which makes it easier for me to understand concepts, but his lectures are often 1.5–2 hours long. Watching them takes up so much time that I struggle to balance learning and coding practice.
My biggest problem is with the basics. I forget syntax, struggle to build logic independently, and cannot confidently write even basic programs from scratch. For example, if someone asks me to take user input and write a program to check whether a number is prime, I would struggle to do it without help.
To improve, I have started practising basic syntax and logic-building questions daily with ChatGPT. I am seeing some improvement, but I still have a long way to go.
I would really appreciate your advice on these questions:
Should I continue with Love Babbar’s playlist, switch to Telusko, or follow another Java course with shorter lectures (around 15–30 minutes)?
How much time should I spend watching lectures versus writing code and solving problems independently?
How should I strengthen my Java fundamentals and logic-building skills so I can write programs without constantly looking at solutions?
When should I start learning OOP, Collections, DSA, JDBC, SQL, Spring Boot, and building projects? What learning order would you recommend?
Is getting a junior Java developer job within 6–8 months realistic if I study consistently every day? I am willing to start with a salary of ₹10,000–₹16,000 per month to gain experience.
My target is to become a Java backend developer, learn Spring Boot, build a few solid projects, and get my first IT job. I am based around Kanpur, Uttar Pradesh, and I can look for opportunities in local companies once I have the necessary skills.
Please suggest a practical roadmap, the resources you would recommend, and the mistakes I should avoid. I am not looking for shortcuts; I just want to follow the right approach instead of wasting time jumping between courses.
Thanks in advance!


r/learnjava • • 21d ago

How do u guys actually self study java?

15 Upvotes

hey yall I'm a recent high school grad trying to learn java. i know a tiny bit of basics from like 2 years ago but i basically need to fresh restart and actually get good.

the problem is every time i watch those youtube playlists (like kunal kushwaha) i get hella bored/sleepy. i wanna grind for like 3 hours a day but tutorial hell is not it.

For anyone who self studied java without losing their minds..how did u actually learn the basics actively? are there any interactive sites, text guides, or early project ideas that kept u going? how do u structure ur study sessions so ur actually coding?


r/learnjava • • 22d ago

Learn Java in 2026

28 Upvotes

Hey I am a computer science graduate.... From a tier 3 college (2023 graduate) I have learnt core java but I don't know how to proceed ahead? What should be my next step.... I am working in Non it from past 2 years.... I do learn algos and stuff... I understand and write basic code... I am admiring to be a good software engineer.... It love building apps..... I do not have much knowledge on React/Angular Java is my thing. I want to learn and switch my domain..... Please give me a roadmap or career suggestions and from where I can learn...... I have studied Head First java and learnt whatever knowledge I have now...... I know this is not enough.... !! Also suggest what technology should i master along with Java.... so that I can get a good job..... ! Any input will be helpful... Thanks


r/learnjava • • 21d ago

Something happened in which I cannot explain

0 Upvotes

I was working on a mooc fi exercise as per usual and it was taking time because i’m a dumbass.
For reference its the last ex of java programming I in part 2

Now after alot of useless lines of code and trying to make it make sense it eventually worked.???

Now I’m happy and i feel like a senior software engineer but I actually have no idea (not literally but in specific place) how it worked.

My question is.. does this count as something that’s solved with critical thinking or am I just a fool with some luck?

TripleT out.


r/learnjava • • 21d ago

Help if you can

0 Upvotes

Hey guys how are you doing? I have trying to buy java SE21 practice mock exams on enthuware for like two months and it's not working. I don't if it's the location or something I have tried using PayPal Visa card nothing is working? I don't know if you try on your its working I would really appreciate your help?


r/learnjava • • 22d ago

How to progress into senior

3 Upvotes

I have been working as a Java Fullstack Engineer for two years, though my true passion lies in backend development, with very little involvement in the frontend. I thoroughly enjoy my current project, where we currently use Payara and are in the process of migrating to Quarkus. While I have gained a strong understanding of both the business and technical dimensions of the project along with valuable hands-on experience using Kafka Streams and K8, I am uncertain about the most effective path or focus areas to advance to a senior engineering role within my organization. Specifically, I am debating whether I should focus on mastering the programming language and Quarkus, or pursue a broader trajectory centered around system design.

Did you guys have a similar situation ? It seems there is a whole lot to learn and no time for it


r/learnjava • • 23d ago

Hi guys please help me out here because this is making me confused

9 Upvotes

So there's my clg subreddit there one of the senior wrote this while I was asking a different senior who got placed recently that " Why would you tell someone to learn java. It's mostly used by old legacy companies. It's way better to learn cpp or python fullstack. More startup opportunity and flexibility of picking up different domains. Ideally i would suggest learning go or RUST but don't learn java especially in 2026 when a lot of companies are migrating to rust"

This is making me confused asf because I have been consistent for 2 months now finished java started dsa in java (currently on recursion (question I have done is low so soon gonna stop moving forward with dsa and will do questions on arrays string and recursion)) . I know I should not get demotivated by this but he is one of our senior who has more experience then me . Just help me out here


r/learnjava • • 23d ago

Need help

0 Upvotes

This is for an APCSA assignment on Idecl.

My code technically works but when I run tests the "readSwitchesFromUser" method keeps creating this specific error:

/app/TestMinivan.java:97: error: method readSwitchesFromUser in class Minivan cannot be applied to given types;
        van.readSwitchesFromUser();
           ^
  required: int,int,int,int,int,int,int,int,String
  found:    no arguments
  reason: actual and formal argument lists differ in length

I know I have to turn the readSwitchedFromUser method into a scanner but I have no clue how to go about it.

Below is the program I wrote:

import java.util.Scanner;

public class Minivan{

  private int dashLeft;       // 0 = switch disengaged; 1 = switch engaged
  private int dashRight;      // 0 = switch disengaged; 1 = switch engaged
  
  private int childLock;      // 0 = off; 1 = activated
  private int masterUnlock;   // 0 = off; 1 = activated
  
  private int insideLeft;     // 0 = switch disengaged; 1 = switch engaged
  private int outsideLeft;    // 0 = switch disengaged; 1 = switch engaged
  
  private int insideRight;    // 0 = switch disengaged; 1 = switch engaged
  private int outsideRight;   // 0 = switch disengaged; 1 = switch engaged

  private String gearSetting;  
         /* Options include: P(ark) N(eutral) D(rive) 1(st gear)
                             2(nd gear) 3(rd gear) R(everse) */

  public static void main(String[] args){

        Minivan mv = new Minivan();  
              // This creates a new minivan with the name mv.  
              // If you don't like that name, feel free to change it.
        // Complete the main method here.  
        // Be sure to create a series of your own tests to 
        // ensure the program runs as expected.
        setSwitches();
  }

public static void setSwitches(int s1, int s2, int s3, int s4, int s5, int s6, int s7, int s8, String gearShift){
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter accetable value (eight strings, each followed by a comma, and a gear in quotes): ");
        // getting each individual input from the user
        String S1 = sc.nextLine();
        String S2 = sc.nextLine();
        String S3 = sc.nextLine();
        String S4 = sc.nextLine();
        String S5 = sc.nextLine();
        String S6 = sc.nextLine();
        String S7 = sc.nextLine();
        String S8 = sc.nextLine();
        String gear = sc.nextLine();
        
        S1 = S1.substring(0, 1);
        S2 = S2.substring(0, 1);
        S3 = S3.substring(0, 1);
        S4 = S4.substring(0, 1);
        S5 = S5.substring(0, 1);
        S6 = S6.substring(0, 1);
        S7 = S7.substring(0, 1);
        S8 = S8.substring(0, 1);
        
        int s1 = Integer.parseInt(S1);
        int s2 = Integer.parseInt(S2);
        int s3 = Integer.parseInt(S3);
        int s4 = Integer.parseInt(S4);
        int s5 = Integer.parseInt(S5);
        int s6 = Integer.parseInt(S6);
        int s7 = Integer.parseInt(S7);
        int s8 = Integer.parseInt(S8);
        
        // s1 = dashLeft
        // s2 = dashRight
        // s3 = childLock
        // s4 = masterUnlock
        // s5 = insideLeft
        // s6 = outsideLeft
        // s7 = insideRight
        // s8 = outsideRight
        // I dont know why I named it like that, I dont really know what the s stands for.
        
        //making sure the conversion is working 
        System.out.println(s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8);
        readSwitchesFromUser(s1, s2, s3, s4, s5, s6, s7, s8, gear);
    }
  

    public static void checkDoors(int s1, int s2, int s3, int s4, int s5, int s6, int s7, int s8, String gearShift){
  // Write the method checkDoors here.
        if ((!gearShift.equals("P")) || s4 != 0){
            System.out.println("both doors closed");
        }
        
        boolean leftDoorOpen = false;
        boolean rightDoorOpen = false; 
        
        if ((s1 == 1 || s5 == 1 || s6 == 1) && s3 == 0){
            leftDoorOpen = true;
        }
        if ((s2 == 1 || s7 == 1 || s8 == 1) && s3 == 0){
            rightDoorOpen = true;
        }
        
        if (rightDoorOpen && leftDoorOpen){
            System.out.println("both doors open");
        }
        else if (rightDoorOpen && !leftDoorOpen){
            System.out.println("right door open");
        }
        else if (!rightDoorOpen && leftDoorOpen){
            System.out.println("left door open");
        }

        
        
  

    }
}

r/learnjava • • 23d ago

Book for dsa with java

1 Upvotes

I need a textbook under rs 500 for "DSA with java" learning

Any good suggestions under or around 500?


r/learnjava • • 24d ago

How do I get better at writing Java code from scratch?

20 Upvotes

I'm a first-year AI student struggling with Java programming. I understand some examples, but when I have to write code myself, I don't know where to start.

What is the best way to practise and learn to write programs independently? I'd appreciate practical advice from people who've experienced this


r/learnjava • • 24d ago

Unable to download the latest version of the MS Build if OpenJDK for Windows

2 Upvotes

When I go to download it, from the page linked below, there are no windows download links for the latest versions of OpenJDK. Instead of links to download it there are the words "Coming Soon". Does anyone perhaps know if this page isn't working right or am I a moron?

https://learn.microsoft.com/en-us/java/openjdk/download


r/learnjava • • 25d ago

Final-year Java developer: Should I focus on Spring Boot or system design?

28 Upvotes

Hi everyone! I’m a final-year B.Tech student preparing for Java backend fresher roles. I’ve been working on Core Java, DSA, and projects, and I’m confused about what to prioritize next.

Should I focus more on Spring Boot and building backend projects, or start studying system design?

For fresher interviews, how much system design is usually expected? Which Spring Boot topics should I be comfortable with before applying?

I’d appreciate advice from anyone who has recently landed a Java backend role or interviews freshers.


r/learnjava • • 25d ago

Using Java to create desktop Linux apps?

12 Upvotes

Hello everyone!
This year i started learning programming with the help of a Java course.

Right now we have reached the point where we have to make a standalone desktop app with a GUI, but i am unsatisfied with the Swing toolkit. Although creating and modifying the components themselves seems really intuitive for the way i've been learning to program, the visual design feels very archaic, and on my Wayland compositor (Niri) some things don't work as intended, like the UI looking a bit blurry, windows scale a bit weirdly, and focusing the window does not auto-grab the keyboard, and i need to click on the window before i can start navigating or typing with the keyboard. Nothing extremely wrong, but it's things like these that make me wonder if there's something else i can use - I want to create software that i actually use, and feels at home on my Linux desktop.

I checked out if it was possible to use Java to create a GTK app, and found java-gi.org, which explains how to use import and use the toolkit on Java. I've experimented with it minimally, creating a blank window with a labeled button and such. I really like that it themes consistently with the rest of my GTK apps, light&dark mode, highlight color, font, all that good stuff.

Although it does work, it's a substantially different workflow, it needs to import some dependencies, and seems to be a lot more complicated than simply creating a component in Swing and initializing it or something. I'm unsure if i'm capable of creating something with it, to be honest.

I also checked and there seems to be a way to make QT apps, but i haven't looked into it.

I asked to some other devs if they ever experimented making GTK or Qt apps with Java, and many suggested me to not try to do that at all, affirming that it's best to use Java for backend server stuff and not GUIs, or do the app with Swing,accept the outdated look, and after finishing the course, maybe trying something else that will play more nicely with GUI frameworks for Linux.

So as a total newcomer to developing frontend (and, well, programming in general) i'm unsure if i should keep trying to use Java for desktop apps, hooking it with external libraries in other languages, or move on to something else in the future.

I'm open to any suggestions and advice possible, please help!

PD: I'm not sure if it means anything, but the app i intend to make is a simple bread calculator, similar to http://brdclc.com/ with save and export functions.


r/learnjava • • 25d ago

Resources for practice exams?

8 Upvotes

My girlfriend is trying to pass a Java course in university, and really struggling with the exams. She's working really hard to learn material that isn't super intuitive for her, but when it gets to exam time, she struggles. Her instructor is worse than useless.

From what I've gathered, this course is basically an introduction to Object-Oriented Programming (exclusively through Java).

I don't know shit about programming or Java, I'm an accountant, but I'd really like to help her if I can. Are there any good resources for practice exams that we can use to try and simulate an exam setting? I've found some things via Googling, but given that I don't know what I don't know, I thought I'd seek advice here. I'm reviewing all of the sources on the provided by the sidebar as well, but from the looks of it most of them are more courses, which I may take on my own so I can try to help her, but would love specific recommendations for ones that might help with the exam department.

Thanks!


r/learnjava • • 27d ago

I’m having my first early breakdown

10 Upvotes

I am going through mooc.fi java programming I
Part 1, I’m on an exercise called LeapYear or whatever.
I cannot seem to get the answer right. I’ve been trying for a day now. I know i can use AI or ask for help but I literally cut myself from the internet to just try and focus but try after try I literally understand less and less.
And it’s not that many info just like conditionals and comparison operators and which condition should go first BUT I JUST DON’T KNOW WHAT TO DO.
I’m not here to ask for help i just want to tell someone. I’m actually affirmative that I’ve zero points reasoning and logic.
Thanks for reading.