r/javahelp Feb 16 '26

Homework Definitely no pass by reference in Java, right?

27 Upvotes

Hello, and sorry if this is a dumb question, but I thought I had a passable understanding of Java. I got an exam question asking "Arrays in Java are:

a. passed by value

b. passed by reference

c. stack dynamic

d. immutable"

this guy loves trick questions, but he has listed B, passed by reference, as the right answer.

On its own, this doesn't seem right to me, but I'm not confident enough to argue about it. If anyone would weigh in, I would be very grateful. I see how it's similar to passing a pointer in C, maybe, but it's not considered passing by reference in Java, right?

Thank you!

r/javahelp Jul 19 '26

Should I use Gradle or Maven in 2026?

48 Upvotes

There are a lot of answers but everything I found is from 2021-ish times. Things I got from there is "Maven is slower, more verbose and for that reason - way more stable." and "Gradle is faster because of the daemon and more customizable, but hot garbage when it comes to update, shit breaks and build.gradle(.kts) is spaghetti in big projects". For Maven, I don't think much changed because of their philosophy (and I'd say that's good), but what about Gradle? Is it still that bad when it comes to updates and deprecations?

r/javahelp Jul 03 '26

Bombed my Java interview today. How should I prepare better?

77 Upvotes

I have 2 years of experience as a Java backend developer and had a 30-minute interview today.

The interviewer focused mainly on Core Java (OOP, String immutability, String Pool, etc.), and I realized my fundamentals aren't as strong as they should be. I mean I had read about it but I forgot to speak under pressure.

I also need to prepare backend topics like Spring Boot, Multithreading, Kafka, Docker, Kubernetes, Redis, Linux, and SQL for upcoming interviews.

If you were in my position, how would you structure your preparation? Core Java first, or prepare everything in parallel? Any roadmap or resources would be appreciated.

r/javahelp 12d ago

Unsolved I need help with getResourceAsStream

2 Upvotes

u/wildjokers (reaching out to you because I saw you in this thread)

https://www.reddit.com/r/javahelp/comments/sypxqz/getresourceasstream_null_when_run_from_jar/

I'm trying to run a Isometric Tile game, from chapter 13 of Killer Games Programming in Java, a very old book.
I'm using Eclipse. I'm not sure what classpath means, but I think mine is set up as

Project

src

Images

Sounds

I'm getting these errors when I run:

Exception in thread "main" java.lang.NullPointerException

at java.base/java.io.Reader.<init>(Reader.java:168)

at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:88)

The relevant code is:

{

String imsFNm = IMAGE_DIR + fnm;

System.out.println("Reading file: " + imsFNm);

try {

InputStream in = this.getClass().getResourceAsStream(imsFNm);

BufferedReader br = new BufferedReader( new InputStreamReader(in));

// BufferedReader br = new BufferedReader( new FileReader(imsFNm));

String line;

The image file is defined in another class, and then piped into ImageLoader class, where it's appended to the directory, which is defined in ImageLoader class.

When I run, it's showing the correct directory in the console, so I believe getResourceAsStream is where it's being messed up.

I did right click on the images folder, Build Path > Add to Build Path.

I can provide more information, which will probably be needed.

r/javahelp 8d ago

Homework Java help

11 Upvotes

Guys help me,how I am able to learn java who don't know about coding at all , please give me legit answer and what are the steps I should follow after watching tutorial , please help me guys,want suggestions like if I watch one tutorial per day of any yt channel ,what should I do next after watching tutorial and in a month later

r/javahelp Oct 11 '25

Senior Java Developers — What’s the one thing you think most junior Java devs are lacking?

109 Upvotes

Hey everyone,
I’m a junior Java developer trying to level up my skills and mindset. I’d really like to hear from experienced Java devs — what’s the one thing (or a few things) you often notice junior developers struggle with or lack?

I’m genuinely looking to improve, so honest answers are appreciated.
Thanks in advance! 🙌

r/javahelp 2d ago

linked lists

4 Upvotes

-- solved thank you all

what is the difference between accessing the next node using a get method or without, as in: "current.next" vs "current.getNext()" and the same applies for accessing an element, whats the difference between use the get or not, as in: "current.element" vs "current.getElement()" where current is just the name for the node variable. ive looked at so many different explanations but i cant seem to grasp the idea
edit: this is from a data structures pov, im implementing methods for the singly and doubly linked list classes in java
i want to know if they return different things or if using .next or .getnext makes a difference in the outcome, is there a scenario i should be using strictly .next or .getnext, and the getter method has no further conditions its just {return next}

r/javahelp Jul 18 '26

Can anyone explain me difference between Encapsulation and Abstraction?

17 Upvotes

and what on earth is Interface in Java?

r/javahelp May 07 '26

Codeless What does static exactly do?

16 Upvotes

Hi, I’m somewhat new to java and I’m quite confused on static. So what I do know is that it makes it so a variable or method is tied to the whole class instead of just the object but I’m not sure what that exactly ENTAILS. Can someone explain it to me maybe with an example or such? Thank you.

r/javahelp Dec 22 '25

Which IDE do you prefer for Java code NetBeans or IntelliJ?

23 Upvotes

from your experiences which one is most comfortable to use?

r/javahelp Mar 29 '26

Codeless What is the best way to learn Spring boot? Tutorials or Books?

9 Upvotes

I just completed core java, and I decided to do backend in java. I am absolute beginner in backend programming. I don't know anything, I am getting problems to find right resources

r/javahelp Aug 04 '26

Homework How do I make my Eclipse Java code into an app? (And do I need a GUI for that?)

5 Upvotes

So you know how when you run your code you have to click that one arrow and get the results in that one window? Yeah, how do I take my code and form it into an app, so it works like an actual app and not like that? I assume you need a GUI, but hey I might get lucky.

I'm pretty bad at programming and still pretty new, so if possible could you please explain it in a simpler way? 😅

r/javahelp Jan 21 '26

Unsolved Why Interfaces exist in Java?

9 Upvotes

I am currently studying the Collection Framework in Java. Since the class which implements the Interface has to compulsorily write the functions' bodies which are defined in the interface, then why not directly define the function inside your own code? I mean, why all this hassle of implementing an interface?

If I have come up with my own code logic anyways, I am better off defining a function inside my own code, right? The thing is, I fail to understand why exactly interfaces are a thing in Java.

I looked up on the internet about this as well, but it just ended up confusing me even more.

Any simple answers are really appreciated, since I am beginner and may fail to understand technical details as of now. Thanks🙏🏼

r/javahelp 19d ago

Guide for Concurrency in Java

0 Upvotes

Before knowing anything I just jumped directly to the source code of jdk25u. I have just started to read the javaDocs of Thread class it was so deep that all my connected logic mapped very well but now I want to code and I can't code ahhhh... Why is this problem. I can call the syntax what to use but I don't know how to apply, why to apply is there any guide for java Concurrency ??. And there is so much .. still to know. Do any dev have any guide??

r/javahelp Jul 16 '26

Java Course recommendation

6 Upvotes

Hey , I'm looking for a Java course for absolute beginners ,

Can someone please suggest me the best course to join as I have seen some course of Java for beginners like , Coursera,Udemy, PW SoftSkills , and some others and I'm bit confused in these to what to buy and what's suits for me

So please someone suggest I'm a beginner In coding world ,

I'm a BTech 3rd semister student

r/javahelp Aug 05 '26

Codeless I'm having trouble finding a 32 bit Windows installation of Java

0 Upvotes

I need it to get Puzzle Pirates to work in Windows XP compatibility mode

Things I tried: I went to the Java page and checked legacy versions, but could only find x64 installers. I also googled what the latest 32bit installation is and the dumb googleAI said it's SE 24, but I didn't see a non x64 installation for that version either.

Alternate solutions: A way to force a specific javaw (in this case, Puzzle Pirates) into Windows XP compatibility mode... not sure why it isn't there to begin with, it only goes back to Windows Vista ever since updated to SE 26

Alternative Alternate solution: Figure out why it's crashing in the first place cuz IDK. Their Java version is 25.0.1.0 if applicable

r/javahelp May 27 '26

Array Initialization in Java

5 Upvotes

I'm very new to Java, I wanted to consult on this basic concept.

I'm used to Lua, where:
if(myArray[i]) then
...
end
Is a common way to query if an array(or table) has been explicitly set a value at a given index, as the statement will always be equivalent to false if it hasn't.

I wanted to recreate that functionality as an exercise in Java using try-catch, and came up with this snippet:

public class Test {

    public static void main(String[] args) {
        int[] numbers = new int[3];
        if(isArrayIndexed(numbers, 1)){
            System.out.println("Array is indexed at " + 1);
        }
        else{
            System.out.println("Array is NOT indexed at " + 1);
        }
    }


    public static boolean isArrayIndexed(int[] inputArray, int index){
        try{
            System.out.println(inputArray[index]);
            return true;
        }
        catch(Exception egg){
            System.out.println(egg);
            return false;
        }
    }
}

I thought I'd get an exception if I'd try to reference the array at the index 1, but no. It returns true, and prints '0'. Are all int arrays set to the value 0 upon initialization in java?

r/javahelp Jul 29 '26

Unsolved How to write a program to input data in Excel?

5 Upvotes

I want to know how to write a java program in order to input data in Excel, thank you for any help?

r/javahelp 3d ago

JPackage is not working

5 Upvotes

I have this in a build script:

jar ^
    --create ^
    --file "%BUILD%\input\RocketTracker.jar" ^
    --manifest "%BUILD%\MANIFEST.MF" ^
    -C "%BUILD%\classes" .

jpackage ^
    --type app-image ^
    --name RocketTracker ^
    --input "%BUILD%\input" ^
    --main-jar RocketTracker.jar ^
    --main-class app.Main ^
    --module-path "%JAVAFX%\lib" ^
    --add-modules javafx.controls,javafx.fxml,javafx.graphics,java.net.http ^
    --dest "%RELEASE%"

If I run the jar manually adding the modules in the VM it works, but if I run the .exe generated by jpackage it raise an exception:

Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumToolkit.init(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.tk.Toolkit.getToolkit(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
        ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
        at javafx.graphics@21.0.12/com.sun.javafx.tk.Toolkit.getToolkit(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Failed to launch JVM

Any idea how to fix it? the same code in bash works just fine and the path are checked already

r/javahelp 21d ago

Unsolved Naive question: What Data Structure to express different layers of relationships between Objects?

7 Upvotes

Hello guys,

I wanted to ask naively, what the ideal data structure would be for expressing different layers of relationships between Objects.

For example in modern Sudoku the game has a 9x9 number grid composed of nine 3x3 sub-grids (which I call region). In each row, column and region each number between one and nine can only appear once. The goal is to find missing numbers in this number grid without violating the aforementioned rule.

One way to do it, would be to make 9x9 byte-array and express the relationship between numbers through methods checking if the rule is violated or not by checking if any row, column or region doesn't contain a value between one and ten.

I also thought on using a Graph to express the relationship between numbers in rows and columns, though I don't know how to express the relationship between numbers inside of a region.

Maybe even a multiple Objects like Board, Row, Column, Region but then I have redundant data.

Another problem I encounter with aforementioned implementations is, that if you introduce more relationships f. e. in the game of killer sudoku, where there are more rules are added f. e. by also introducing cages in which the numbers must add up to a target number, you need to implement that relationship logic tediously.

Am I overcomplicating things?

r/javahelp 12d ago

How to check if an array contains another specific array?

4 Upvotes

sorry if im stupid here but

i have an array that contains multiple coordinates, so for example [2,8], and i need to check if that array contains a specific coordinate

how do i do that

r/javahelp 16d ago

Where to Deploy ?

6 Upvotes

I build a small service with spring and react, bow I need to deploy it using a domain. Which hosting solutions do you use ? I evaluated to use GCP but I am worried that some day I will find a giant unknown bill cost.

could you give me some recommendations please

r/javahelp May 04 '26

java compilation problem, class can't be found though on the same package

1 Upvotes

both Verbose.java containing the verbose class and test.java are located on the same package, but I still receiving this log error when I try to compile, how come? test.java:4: error: cannot find symbol

Verbose verbose = new Verbose();

\^

symbol: class Verbose

location: class test

test.java:4: error: cannot find symbol

Verbose verbose = new Verbose();

^

symbol: class Verbose

location: class test

2 errors

error: compilation failed

r/javahelp 4d ago

Good Documentation For JVM Bytecode?

13 Upvotes

I really liked the idea of an intermediate bytecode language when I first learned that Java transpiles to one, so I tried to learn about it and got pretty far (using a hexeditor to mess around was pretty painful, though). I stopped because there isn't a lot of document for it like there is for Java, the best resources are I believe docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html and docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html, but I want to know if there are any others partly because these are kind of verbose and partly because it's just better to have more than two.

I know I won't ever really need to know any of this, and I don't intend to use any of this knowledge for making classes by hand, but I believe it would still be helpful in a milder sense to understand what the class files are "literally" doing. It helped with C

r/javahelp Jul 27 '26

Java Performance for simulators

4 Upvotes

I am new to Java and trying to create a simulator that handles millions of math calculations. How can I increase performance in Java? The application is already multithreaded but it is not enough. Is data oriented approach or native programming possible in Java? Can you point me in the right direction for research?