r/javahelp • • Dec 03 '25

What’s the difference between record and class in Java?

22 Upvotes

i was watching a video about SpringBoot 4.0.0 which is the new version , and in the video he used record Student instead of class Student , which is the first time i saw this type of class (been working with Java (mostly 11) for like 4 years and Spring for 2 years), and it confused me a bit

From what I understood :

record was introduced as a preview in Java 14 and became stable in the version 16

its basicly a shorthand simple of a class like a DTOs ?

it automatically generate the constructor ,getters ,setters ,toString() ,equals() and hashcode()

its also immutable by default since all fields are final but why not use just abstract class then ?

you cant use records as entities in JPA because those need mutable fields

so my question is when is it like clear to use them ? and do i use records for DTOs instead of regular classes


r/javahelp • • Sep 21 '25

What do you use for web programming nowadays?

22 Upvotes

I have been into pure Java back-end programming for years, and I'm a bit lost of what is used nowadays to web server/html programming.

In my days, I used JSP and then some frameworks like GWT and Apache Wicket.

But if today I should begin with a new project, I don't know which tecnology to use...

Like, do you use client-side tools like angular or react or vue or flutter ?

Or vaadin or other pure Java framework ?

Thanks


r/javahelp • • Jun 02 '25

Trying to learn Java backend the hard way — does this plan make sense?

22 Upvotes

Hey everyone,

So I’ve learned Java before and done some DSA and OOP stuff — like Leetcode and basic problem solving — but I kinda want to start fresh and go deeper this time. I’m planning to get into backend development with Java (eventually Spring Boot), but I don’t want to jump into frameworks right away without understanding what’s going on under the hood.

Here’s the rough plan I’m thinking:

  • Revisit OOP and DSA while I work on backend stuff (want to get better at problem solving too)

  • Learn Java multithreading and concurrency properly (threads, pools, sync, deadlocks, etc.)

  • Dive into networking — sockets, HTTP, how servers actually talk to clients

  • Build a basic HTTP server using just Java and ServerSocket, handle multiple requests with threads, parse basic HTTP manually

  • Connect it to a database with JDBC

  • Work with JSON

  • Then eventually move into Spring Boot when I understand what it's abstracting

I’ve got time to learn and I want to actually understand how things work instead of just throwing annotations around. Does this sound like a solid approach?

Also, if anyone knows good resources (videos, tutorials, books, whatever) for multithreading or building HTTP servers from scratch in Java, or any related topic to what I've mentioned — I’d love some recommendations!

Thanks 🙏


r/javahelp • • Mar 02 '25

Offer to Review your Java Code

22 Upvotes

I love helping Java devs improve their OO design and clean code skills. I have 7+ years of industry experience and have a strong focus on XP practices.

If you’d like a free code review, drop a GitHub link or snippet, and I’ll provide feedback!


r/javahelp • • Oct 13 '24

Transitioning to Java backend: What should I learn ?

22 Upvotes

Hi! I am a college student in my final year, and I'm on a mission to become proficient in backend development using Java within the next year. I have experience with TypeScript and Next.js for frontend and backend work mostly crud with db and some api calls to openai, but I'm pretty new to Java.

Currently, I'm working through Abdul Bari's Java course on Udemy, which has been great so far. However, I'm looking for additional resources, especially those focused on backend development with Java.

Can you recommend any:

  1. Books or online courses that bridge the gap between basic Java and backend development?

  2. Project ideas that would help reinforce backend concepts?

  3. Frameworks or tools I should focus on learning?

  4. Tips for someone transitioning from TypeScript to Java for backend work?

Any advice would be greatly appreciated. Thanks in advance for your help!


r/javahelp • • Dec 08 '23

What IDEs use for java?

22 Upvotes

I have been using vscode for python, but now in school they are going to teach us POO in java, so i woder if a can keep using vscode or is a better option like netbeans or eclipse.


r/javahelp • • Apr 23 '22

I have a job interview for a company that works in Java, what are some possible things I should read up on?

22 Upvotes

Hello, I have been applying for some jobs and I've come to the next stage for a company that develops java applications.

Now, I don't have any issues learning syntrax, information about it and such but what is something that could be smart to know? maybe the most famous frameworks for building a java application?

Should I spend time on spring?


r/javahelp • • Jan 20 '22

How do I connect my back end to my front end?

22 Upvotes

Hello,

For a java course, I'm following we are supposed to create an app for our end project.

I finished the back end and the front end but I have no clue how to connect them to each other.

I created the front end using react and the back end using java/spring-boot.

Users must log in before using the app but when I launch my front end it does not redirect you to the login page but in the back-end, it automatically redirects you to the login page.

What should I search on google to find the right way?
I was not able to find any good tutorials on how to do this.

If you need more information please let me know

Thank you in advance


r/javahelp • • Apr 26 '21

Solved How random is Java.util.Random() ?

22 Upvotes

I am trying to simulate a coin flip, to do this I generate a random number either 0 or 1. 0 for heads, 1 for tails. I tested this by flipping a coin 1000 times, but 66% of the times it is heads.

int coin_flip() {

Random rand = new Random();

int flip = rand.nextInt(2);

return flip ;

}


r/javahelp • • Mar 08 '21

Transitioning from Android developer to Java backend developer

22 Upvotes

I am an Android developer with 3 YOE in Android and several personal personal projects before that working with both Java and Kotlin. I want to transition to a Backend role for better opportunities since I feel within a few years mobile development is going to be taken up by the cross platform movement at least partially.

What should I focus on learning in Java beyond what is used in Android? Bear in mind that I haven't touched anything beyond Java 8 so which is the minimum Java release you are expected to know for a Java backend developer?


r/javahelp • • Feb 07 '21

Unsolved Serialisation Java8

22 Upvotes

Yesterday i took an interview where i was asked "why serialisation is said to b lazy" ?

I certainly could not answer this as i have never ever come across anything where the serialisation is considered lazy. After the interview i did a quick google and yet no ans.

Can anyone please help know the right ans for this with detailed explanation

java8


r/javahelp • • Jan 02 '21

Java Spring Project Ideas

22 Upvotes

Hey all,

I'm not necessarily new to coding but for some reason, I always have such a hard time figuring out projects to do on my free time. Could someone help me out and kind of give me ideas or projects (common ones?) that I can code up using Java Spring. Backend code or something. Projects I guess that are useful and will help me grow! I know it's such a vague question but I really want to code in my free time but never know what.

Could someone give me a few beginner and intermediate level projects to work on? I would really appreciate it! Possibly something in the Financial Services world or something!

Thanks in advance!


r/javahelp • • Oct 19 '20

What are the challenges with mixing reactive programming with non-reactive programming?

22 Upvotes

For the project that I'm working on, the database side has to be regular non-reactive programming with Spring Data JPA as the database is RDBMS. But we want to have other parts of the application such as service layer to be built in a reactive way because they talk to external services that have big delays in responses.

So, while a service layer is contacting with database in a non-reactive fashion and the same service is contacting external services in a reactive fashion, would there not be any compatibility issues b/w those?

Is it wise to have one part of application in reactive and other part non-reactive?


r/javahelp • • Oct 08 '20

Email checker

22 Upvotes

So i have a long comprehensive lab and i need to check if a email has .edu inside of it ive been trying mainly for() but thats all i dont really get how to check if some one can lead me in the right direction i would appreciate it.


r/javahelp • • Oct 07 '20

I can't totally understand how many times will the inner loop body execute in a given code!

22 Upvotes

EXAMPLE:

int row;

int col;

for(row = 0; row < 2; row = row + 1) {

for(col = 0; col < 3; col = col + 1) {

// Inner loop body }

}

}

/*the fist for loop will execute twice outputting ( 0 1 ) , since the condition is row < 2

the second for loop will execute 3 times! outputting ( 0 1 2 ) since condition is col < 3

so the total should be 3+2 = 5, 5 inner loops!

why is the answer 6??? why do we need to multiply 3*2? */

//sorry about the basic question, i'm very new to programming and I tried to look this online, but no one could make me understand this


r/javahelp • • Aug 25 '20

Why is setting up JavaFx such a hassle

22 Upvotes

I’ve tried for like 2 hours now to set it up on a new pc I just built and I cannot get it to work still.


r/javahelp • • Aug 14 '20

Are there good books to learn spring and/or springboot?

22 Upvotes

Title is self descriptive.


r/javahelp • • Jul 07 '20

Define a function which takes any number of arguments

22 Upvotes

Hi all,

Define a function which can take any number of arguments and returns the sum of all the elements (only int and float type).

The arguments can include integers, string, char, floats, boolean (all the primitive data types) and arrays.

if you are passing an array, again it might have all the primitive data types.

its like:

float result = functionName(1, 0.5, "Hello", 'S', true, someArray, 100.5, 46, 24.332, someArray2, "Yes")

// the number of arguments can be any. The function should be able to take it.

This was asked to me in an interview. The interviewer told that your function should be able to return the sum of only integer and floats (not even byte or double. Only int and float)

I wrote the program although it was quite huge (not so much though). I wrote it on a piece of paper. When I came home, I tried to replicate it and ran on my PC. It didnt :/. I had used a try catch concept for this.

Can you guys help me out with an efficient program for this problem? Thanks!


r/javahelp • • May 28 '20

What is the difference between compile time vs run time?

22 Upvotes

So I was searching up the difference between Array and Linked List and i came across the comparison of their storage allocation. It says that:

  1. Array- Element location is allocated during compile time.

  2. Linked List = Element position is assigned during run time.

I'd really like to understand and know the difference between these two.

Thank you in advance!

Edit: Can someone please explain when do i use Linked List over Array/Array List? Thank you!


r/javahelp • • Mar 30 '20

What's the best way to learn Java 11 as a Java 8 Developer?

22 Upvotes

Hi, I am looking for a way to learn Java 11 in a most efficient way.

  • In a couple of weeks, I want to get a good grasp of features and best practices. So that I can pinpoint some bad practices in projects at work.

  • In a couple of months, I want to get in depth knowledge so that it'll be proficient to get Java 11 certificate.

What do you suggest? Thanks!


r/javahelp • • Mar 19 '20

Open sourced projects using Spring Boot?

22 Upvotes

I'm working on moving into Java Spring Boot development. What are some great open sourced projects that would be great to contribute to for a new job?


r/javahelp • • Feb 17 '20

Difference between this and super when calling a method from a parent class

22 Upvotes

Could anyone please explain to me what is the difference between this and super in this context? The output for both is the same. When should I be using super vs this?

public class A {

	public void doA() {
		System.out.println("A");
	}
}

class B extends A {

	public void trySuper() {
		super.doA();

	}

	public void tryThis() {
		this.doA();
	}
}

class C {
	public static void main(String args[]) {
		B b = new B();
		b.trySuper();
		b.tryThis();

	}
}

r/javahelp • • Feb 03 '20

Syntactic sugar: static references to instance methods?

22 Upvotes

Hello!

I found the following thing a little bit strange. Consider the following class:

class Example{

  public void foo(int x){

  }

  public void bar(){
    
  }
}

Now I can make an object, get a method reference to an instance method and then use it.

Example e = new Example();

Consumer<Integer> ex = e::foo;

ex.accept(4);

Method foo(int x) is clearly a Consumer<Integer>. How ever, I have no idea why the following works:

Consumer<Example> ex2 = Example::bar;

ex2.accept(new Example()); 

First, it refers to Example::bar in a static way, even though it is an instance method.

Secondly, Consumer<Example> means it consumes Example -objects, which implies there is a method accept(Example e). But Example::bar is clearly not a Consumer<Example>

I guess the

Consumer<Example> a = Example::bar; 

is translated to following:

Consumer<Example> a = (x) -> x.bar();

I could not find this anywhere in the tutorial or any other article that would explain it. I'd think that if syntactic sugar like this exists, where's the documentation?


r/javahelp • • Jan 01 '20

I’m looking for a hard java project to impress my school.

22 Upvotes

I’m a year 12 currently studying java in school. We have to make a project in java and I plan to make mine very good, but I have no ideas

The only necessities is that is used a database and, in some capability, teaches or helps improve the skills of the user. (Whether through code that emulates dualingo to a game that helps teach math)

I’m not asking for help to code the project and I don’t mind if it’s a hard project, but I would really appreciate any ideas. Thank you in advance