r/JavaProgramming • • 3d ago

DSA Finally Clicked When I Learned These 14 Patterns

Thumbnail
javarevisited.substack.com
3 Upvotes

r/JavaProgramming • • 3d ago

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

Thumbnail reddit.com
2 Upvotes

r/JavaProgramming • • 4d ago

new program (I'd like some help with it, if possible) c:

3 Upvotes

This is the program. I built it off of a couple for loops and some array tinkering Although, it is working properly, I'd like to be able to type the suit of the card along with the number. AI has helped me a little bit, but the idea of how the cards are displayed in the array is my idea.

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

// creation of the deck

ArrayList<String> deck = new ArrayList<>();

String[] suits = {"Hearts", "Diamonds", "Clubs", "Spades"};
String[] ranks = {
"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"
};

//Generation of the 52 cards

for (int i = 0; i < suits.length; i++) {
for (int j = 0; j < ranks.length; j++) {
deck.add(ranks[j] + " of " + suits[i]);

}
}

// Shuffle the deck

Collections.shuffle(deck);

// creaation of the card grid

//2D array

String[][] cards = new String[3][3];
String table[][] = {

{"?", "?", "?"},
{"?", "?", "?"},
{"?", "?", "?"}};
boolean[][] drawn = new boolean[3][3];

// Place 9 random cards into the grid
int cardIndex = 0;

for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
cards[i][j] = deck.get(cardIndex);
cardIndex++;

}
}
int totalDraws = 0;
System.out.print("=== DRAW A CARD GAME ===");

// Game Loop
while (totalDraws < 9) {
System.out.println("\nYour card table:");

//Display the table\
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
System.out.print(table[i][j] + "\t");
}
System.out.println();
}
System.out.print("\nChoose a card (1-9 and put the suit)");

int choice = scanner.nextInt();

// Validate choice

if (choice < 1 || choice > 9) {
System.out.println("Choose a number between 1 nd 9!");
}
// Convert choice into row and column

int row = (choice - 1) / 3;
int column = (choice - 1) % 3;

// Check if card was already drawn

if (drawn[row][column]) {
System.out.println("You already drew that card!");
continue;
}
// Reveal the card
table[row][column] = cards[row][column];

drawn[row][column] = true;

totalDraws++;

System.out.println("You drew: " + cards[row][column]);
}
System.out.println("\n===== Game Over ======");
System.out.println(("You drew all 9 cards"));

scanner.close();
}
}

Original code looks a little bit like this; there was some more to it, but that's the jist of it.

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        String[][] twoDarray = {
                {"x", "x", "x"},
                {"x", "x", "x"},
                {"x", "x", "x"}
        };

        Scanner scanner = new Scanner(System.
in
);

        System.
out
.print("Enter something: ");
        String userinput = scanner.nextLine();

        twoDarray[0][0] = userinput;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.
out
.print(twoDarray[i][j] + "  ");
            }

            System.
out
.println();
        }

        scanner.close();
    }
}

r/JavaProgramming • • 4d ago

How to remember the java and revise in 1 month

Thumbnail reddit.com
3 Upvotes

Tell the tips guys, it helps me.


r/JavaProgramming • • 4d ago

Update Java Love Code

Thumbnail
chatgpt.com
1 Upvotes

love.java

what aspects lack in the code?


r/JavaProgramming • • 5d ago

Career Opportunity | Java Developer | Canada | 0–3 Years Experience

10 Upvotes

Hello Team,

Greetings from the Atlas Globals Team

We are currently seeking enthusiastic and motivated candidates for Java Developer opportunities in Canada. This is an excellent opportunity for fresh graduates and professionals with up to 3 years of experience who are looking to advance their careers in software development.

Only candidates currently residing in Canada are eligible to apply.

Position Details:

  • Job Title: Java Developer

  • Experience: 0–3 Years

  • Location: Canada

  • Employment Type: Full-Time

Required Skills:

  • Strong knowledge of Core Java and Advanced Java.

  • Understanding of Spring Boot and Spring Framework.

  • Knowledge of REST APIs and Microservices.

  • Familiarity with SQL, MySQL, or PostgreSQL.

  • Understanding of Object-Oriented Programming (OOP).

  • Good analytical and problem-solving abilities.

Eligibility Criteria:

  • Bachelor's degree in Computer Science, Information Technology, Engineering, or a related field.

  • Freshers and candidates with up to 3 years of relevant experience are welcome to apply.

  • Relevant technical certifications will be an added advantage.

Application Process:

Interested candidates are requested to share their updated resumes with us at:

Email: [email protected]

We look forward to connecting with you and exploring potential career opportunities.


r/JavaProgramming • • 5d ago

How 13 bits are required to store 7 decimal digits precision in Java?

Post image
2 Upvotes

r/JavaProgramming • • 5d ago

This is a little program that I created with the help of AI

2 Upvotes
This is a little program that I created with the help of AI. I only used AI when I became stuck on certain parts of the program. The program allows the user to input a file directly into the IDE, whcich allows the terminal to output what is in the file; it also allows the user to select a file to read, and finally allows the user to select a place to save a file and enter text to be saved into a file. 



import javax.swing.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.awt.Desktop;
import java.util.Scanner;

import static java.awt.SystemColor.
text
;

class newProject {
    public static void main(String[] args) throws IOException {

        // capture user input:

        Scanner scanner = new Scanner(System.
in
);
        String UserData = scanner.nextLine();
        System.
out
.println(UserData);

        if (UserData.equals("1")) {

            Files.
lines
(Path.
of
("C:/Users/zgarr/OneDrive/Desktop/text.txt"))
                    .forEach(System.
out
::println);

        } else if (UserData.equals("2")) {

            File directory = new File("C://documents");

            try {
                ProcessBuilder explorer = new ProcessBuilder(
                        "explorer.exe",
                        directory.getAbsolutePath()
                );

                explorer.start();

                // User selection for number 2

            } catch (IOException e) {
                e.printStackTrace();
            }

        } else if (UserData.equals("3")) {

            System.
out
.print("Enter a name for your file");
            String fileName = scanner.nextLine();
            if (!fileName.endsWith(".txt")) {
                fileName += ".txt";
            }

            String folder = 
chooseSaveFolder
();
            File fullPath = new File(folder, fileName);

            System.
out
.println("Start typing your text to save it. Type exit when finished");

            try (FileWriter writer = new FileWriter(fullPath)) {

                while (true) {
                    String line = scanner.nextLine();

                    if (line.equalsIgnoreCase("EXIT")) {
                        break;
                    }
                    writer.write(line + System.
lineSeparator
());
                }
                System.
out
.println("saved doucment too " + fullPath);
            } catch (IOException e) {
                System.
out
.println("Error saving file" + e.getMessage());
            }

        } else {

            System.
out
.println("Wrong selection");

        }

        scanner.close();

    }

// This method helps the user select a place to save the file

    public static String chooseSaveFolder() {

        JFileChooser chooser = new JFileChooser();
        chooser.setDialogTitle("Select a folder to save your file");
        chooser.setFileSelectionMode(JFileChooser.
DIRECTORIES_ONLY
);

        int result = chooser.showSaveDialog(null);
        if (result == JFileChooser.
APPROVE_OPTION
) {
            return chooser.getSelectedFile().getAbsolutePath();

        }
        return ".";
    }
}

r/JavaProgramming • • 5d ago

Java 25 (with virtual threads) for a startup

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 5d ago

I want a web to upload my backend with java spring but for free

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 5d ago

Fresher confused about choosing a Backend Tech Stack: Python Django vs Java Spring Boot. Which should I learn?

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 6d ago

Recommend resources to learn Java in big 2026

22 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

(3) Telsuko's older Java playlist

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.


r/JavaProgramming • • 6d ago

Top 10 Educative Courses for Software Engineers in 2026

Thumbnail
medium.com
5 Upvotes

r/JavaProgramming • • 7d ago

What common mistakes do beginners make while solving DSA problems in Java ?

9 Upvotes

Many beginners start learning Data Structures and Algorithms but struggle to solve problems independently. I'm curious to know what challenges Java beginners face while practicing DSA.


r/JavaProgramming • • 7d ago

Experimenting with a lightweight alternative to Spring Boot for small servers

3 Upvotes

I've been working on CoilBase, a small open-source Java foundation built around a simple idea: Spring-like comfort, without the weight.

I like Spring Boot's controller → service → repository structure, but wanted to preserve that development experience with a smaller runtime footprint.

CoilBase uses Jdbi for SQL-first persistence, explicit transactions, and constructor wiring. It works with lightweight HTTP frameworks like Javalin and Avaje Jex.

I recently compared five Java application stacks on a 512 MiB VM with MariaDB running alongside the application.

On HotSpot JDK 27, median application memory was:

  • Spring Boot + Spring JDBC: 181–188 MiB

  • Javalin + CoilBase: 121–136 MiB

  • Jex + CoilBase: ~116 MiB

The same CoilBase services and repositories worked across Javalin, Jex, and Micronaut. I also tested GraalVM Native Image, with even smaller footprints.

GitHub: https://github.com/PVRLabs/coilbase

Experiment and results: https://pvrlabs.xyz/articles/five-java-stacks-512mb-vps.html

Curious what others think of this approach. Would you consider a smaller, explicitly wired stack for a small Java service, or do you generally stick with Spring Boot?


r/JavaProgramming • • 7d ago

I Read Clean Code: A Handbook of Agile Software Craftsmanship, 2nd Edition and It’s Awesome

Thumbnail
medium.com
2 Upvotes

r/JavaProgramming • • 7d ago

HCLTech HR Interview

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 7d ago

How do developers study Java src code ?

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 8d ago

Rate my first java project

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 8d ago

I am i 1st year btech student .Where can I learn Java/python better i tried learning from yt

Thumbnail reddit.com
1 Upvotes

r/JavaProgramming • • 10d ago

Reliable Background Jobs in Java with JobRunr - Ronald Dehuysser | IntelliJ IDEA Tech Talks

10 Upvotes

What happens when your invoices end up on a dead letter queue? If you're Ronald Dehuysser, you build an open source library to make sure it never happens again.

In this episode, Ronald, creator of JobRunr, joins us to talk about running background jobs in Java. He shows how to set up JobRunr with Spring Boot, enqueue and schedule jobs, and keep an eye on them in the built-in dashboard. And he explains why he loves exceptions. (Yes, really.)

We also cover carbon-aware job scheduling, recurring jobs (and why nobody likes writing cron expressions), whether you need Kafka, and the time-traveling bug that took years to track down.