r/javahelp • • Mar 05 '25

Are lambda expressions used much by professional coders ?

19 Upvotes

Just been studying up on them some as I am basically a hobbyist who just getting back into Java after about 10 or 12 years away from coding much. I appreciate the way lambda's allow coders to bypass constructors, initialization and calling methods by name , but on the other hand if you already have a good knowledge of the object classes and available methods , why not just do that ?


r/javahelp • • Feb 27 '25

I’m a beginner coder (1st year uni), didn’t understand anything at uni for 6 months—now self-learning and wrote my first program in a week! Feedback?

19 Upvotes

So, I’m a first-year CS student at university, but for the last 6 months (and even before uni), I didn’t understand a thing. Literally nothing clicked. Now, I finally started learning programming properly on my own, going back to the fundamentals, and within my first week, I built this ATM program in Java.

I know it’s super basic, but as my first program, I’d love some feedback—best practices, things I can improve, and how I can refine my approach to actually get good at this. My goal is to not just pass uni but also land jobs and internships down the line. Any advice, critique, or resources to help me level up would be amazing!

here is the link to my github code https://github.com/certyakbar/First-Projects.git


r/javahelp • • Sep 01 '22

What do you guys use to create/design gui's?

19 Upvotes

Currently I'm using Scenebuilder but I find the documentation to be quite lacking, so I wanted to know if there are any better options.

I'm fairly new to java.

Thanks


r/javahelp • • Jun 18 '22

Looking for a book like ‘Automate the boring stuff with Python’ for java

19 Upvotes

The book was really well-written, and it was my first introduction to Python. Noe I will have to learn some Java, and I was wondering if there is a book like that - but for Java. At least something that’s kinda fun to read. Thank you all in advance!


r/javahelp • • May 05 '22

Unsolved Creating a GUI in java

19 Upvotes

I’ve been out of the programming game for a while, when I was in college i made GUIs with JavaFX. I was wanting to start to make a game just for a hobby, but then I found out the newest JDK no longer supports JavaFX. Was there a better one introduced or did they fall back onto AWT?


r/javahelp • • Feb 10 '22

Codeless Question to people seeking help : Are you using an IDE?

19 Upvotes

I've seen a number of posts that lead me to believe that the people seeking help aren't using an IDE. I was wondering if that was the case and if so, why?

I suspect that, perhaps, it is being discouraged by whatever learning environment people are in. I saw one comment that the person wanted to learn everything without an IDE just doing things for them.

People learn in different ways. It's my opinion that, when learning to code, there is a lot of parts to learn and, for a successful program, they all have to perform correctly. It isn't easy to try to learn everything at once. Having an IDE that supplies errors and warnings can be a learning tool.

When trying to figure out why your code isn't working, in the absence of an IDE, you can find yourself trying to fix the wrong parts. Or, fixing something that needs fixing, only for things to still not work and leading you to believe your fix must be wrong, when it's another error elsewhere that prevents your fix from doing what it should.

I'd like to end this with one bit of unrelated advice. Start with a small working part of your code. Add bits in a way that you can verify that it still works. If you break it, look at the last changes you made and figure out how you broke it. Writing the whole thing then trying to figure it out is harder. If tasked with asking a user to input a bunch of numbers then telling them the highest/lowest/average, maybe start with just asking them a number. If that code runs, then try also telling them that number. Slowly extend working code.


r/javahelp • • Nov 15 '21

Roadmap Java

19 Upvotes

Roadmap Java

Hi guys. Im a Java developer with 2 years of experience and want to improve on the Java stack. I found this roadmap on Internet about Java. What do you think guys?

Why he choose jdk 8? Why eclipse and not intelliJ?


r/javahelp • • Aug 17 '21

"Java is not fully object oriented because it supports primitive data type like int, byte, long etc. which are not objects"- Please explain the quoted statement.

19 Upvotes

"Java is not fully object oriented because it supports primitive data type like int, byte, long etc. which are not objects."

How does the primitive data types makes java not fully object oriented? please explain with example.


r/javahelp • • Jul 24 '21

Unit testing with Mockito framework... Why do we actually have to do it? What's usually the point?

19 Upvotes

Sorry if this is dumb but I just got a job and introduced to my first assignment yesterday. The task at hand was to implement unit tests using the mockito, powermockito, and junit framework for about 4 classes, each with about 300 lines, to be done by end of day Tuesday. I have 2 yeo but I've never done unit tests before, and I really don't get what the purpose of them is, but I was told the assignment was given "so that I can better understand what's going on within the codebase." While this makes sense, what I'm finding is that I'm more struggling to learn about what unit testing actually is, what I'm supposed to test, and what the actual point of it is. It's also a bit interesting because people with less software dev experience and exposure are introducing this to me, and I'm really not getting what the concepts are for - it seems like a special type of programming that I've just never seen, but also seems arbitrary to some degree, but it also seems simple for most devs just getting introduced to all of it.

So I go into one method, and I test it out. It's like a response.getContent(), and I do when(respones.getContent()).then(mock(Content.class)) or something, and then I'd go into the code and behave as a compiler testing out each of the individual components. But... obviously they all work. They all have return types that work, and that behave as actual classes. But then there are if statements to test, for loops, array lists, and it seems as though JUnit testing doesn't deal with most of that stuff until you get to an actual method call. Then once you get to that method call, you go into that method, and you write tests for that method in the function that has an actual @Test annotation. Do I have that right? Anything I'm missing?

I'm just unsure as to what the conventional wisdom is behind unit testing. If something were to break, I could test it manually, or test an endpoint in Postman, but these unit tests seem like they're made up, or that the only point of them is to just "become the compiler" and better understand the code that way. Even the other unit tests I've seen in this project seem really hand-wavy, and don't even seem to test everything. Then it would also seem that unit tests don't serve any inherent purpose, since they're static, and you can't see what's going on within the code in a more dynamic setting, like when it's live.

Could someone help my understanding? I am having some trouble understanding what value unit testing actually brings. Thanks.


r/javahelp • • Jul 04 '21

What should I do when I am not motivated to code?

19 Upvotes

I just turned 20 and my experience with coding is quite limited. CS is my major, but I feel little to no motivation when it comes to coding assignments from my online school. The language I have been studying is Java, but to be honest, for a beginner, I feel like I do not like it. I am enrolled in a 6-week class about Java Data Structures, which began this week. I honestly do not feel comfortable with it, considering the fact that I also work part-time. For my assignments, I mostly copied and pasted solutions from here and paid little to no attention to what I was doing. I just don't feel like I have a passion for programming. Should I switch careers? Should I focus on Python instead (Python makes me a little more excited about coding)? What do you guys think I should do?


r/javahelp • • Jun 19 '21

Codeless Modern books on "designing" web apps (REST etc)

19 Upvotes

Hi, i would like to ask if somebody knew any good books about creating web apps.

I am not interested so much about the framework/tool usage, since i know spring quite well, but more about how the code is supposed to be organized, which parts should be in services, how to handle dtos and complex logic, how to organize the domain etc.

I can never seem to understand what classes i should have. Now i have my entities, services that save / get those entities with some validation or event notifications and controllers who serialize those and that's it


r/javahelp • • May 10 '21

Codeless How can I learn the "magic" that underlies the Spring Boot Framework?

19 Upvotes

I've successfully completed several projects using the Spring Boot Framework. I still don't understand it, however. I can't pass interview questions like "explain what an Application Context is", or "What is a Bean?".

I've figured out how to put the correct annotations in the right spots to get the effects I want for a basic Spring Boot app, but I'm kind of stuck now.

I have been unable to find a solid guide online that explains the core of the Spring Framework in simple terms. I just get overwhelmed by the guide using jargon that is effectively meaningless to me. I really need an "explain this like i'm 5" to understand the why and how of the Spring framework. Does anyone know of anything like this? A Coursera course, MooC, etc or youtube series would be best. I find I learn new technology the easiest this way. A book or web text-based tutorial is also fine if that's all there is.


r/javahelp • • Mar 10 '21

Codeless How well does Visual Studio Code work as a Java development IDE?

19 Upvotes

I've been developing in Java for about 5 years now, and for all that time I've been using Eclipse. The problem I have with Eclipse is that it can be frustratingly slow at times. The project we work on has around 150 Ivy dependencies (including transitive dependencies), so at times when looking up Intellisense recommendations for classes, Eclipse sometimes just freezes. As in the IDE locks up, key presses don't go through and by the time it's over the intellisense box has timed out, oftenside alongside an Eclipse plugin exception dialog because of said timeout. Events like this happen a couple times per day, and it's always frustrating when you're getting slapped out of your code like that. They've even seemed to have gotten even worse now that we've swapped to Java 11 for daily development, although that might be because we went from Eclipse Luna and Mars to Eclipse 2020-0X. Then there's also the problem that with the transition to Java 11, we had to move to a newer eclipse version that does not support a number of plugins we used to use.

Now, a couple months ago I swapped over my frontend development environment for VS Code because the syntax highlighting for frontend code in Eclipse is so horrendous and often even nonexistent in my experience. It was such a welcome change that I'm considering switching my Java development over to Visual Studio Code as well. However, in order to do that, there are some considerations:

  1. We currently use self-hosted Subversion as our source control (though we are considering migrating over to Git because of various reasons), so we 100% need support for that. I don't think this will be a problem though.

  2. We use Ivy as our dependency management, in 2 ways: through the Ivy Dependency Management feature in IvyDE in Eclipse so we get Intellisense and integration with our tests, and through an Ant script that generates a temporary directory in our project with dependencies managed in folders. Again, 100% required.

  3. We use self-hosted Jira for tracking our sprint items, and use Mylyn integration in Eclipse to generate change sets that automatically get added as commit messages with the Jira issue id, for easier tracking of which change is part of which item, so it is important that we can keep this more or less automated. I understand that Atlassian has a Jira plugin for Eclipse, but I'm unsure whether this plugin works without Bitbucket.

  4. We need a way to run Ant scripts directly from the IDE, including support for adding additional jars to the Ant classpath. We currently use Ant as our scripting language for most scripts, and while again we might migrate to Gradle, that's not for any time soon. we use ant for our build script (though this is started with a cmd script), our script that deploys newly developed code to a local environment, the above mentioned Ivy dependency script and some other small scripts here and there.

  5. Many of our jars need to be turned into OSGi bundles for use in Karaf. We do this in 2 ways, through our build script and through our local deployment script. Both of these currently require additional setup inside Eclipse related to the BND classpath and a BND home. Again, we really need this.

  6. We run unit tests with Junit and integration webtests with TestNG + Selenium. We need support for both of these test engines.

  7. We use separate workspaces and working sets to maintain 2-3 branches of our code at the same time. some of us have a separate workspace for each branch, others have 1 big workspace folder with working sets for each branch. this would be mostly a nice to have, but at least 1 developer really wants this.

Based on the above requirements, would Visual Studio Code be a feasible alternative for Eclipse for Java development?


r/javahelp • • Feb 28 '21

What exactly is @NoRepositoryBean used for ?

19 Upvotes

Hi expert,

I desparately need help to understand what is

Annotation Type NoRepositoryBean

Here's the link provided by Springboot :

https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/repository/NoRepositoryBean.html

But, really, I don't understand whatever that is written there.

Can someone explains to me in simple layman terms and how is this being used?

Tks.


r/javahelp • • Feb 21 '21

I'd like to ask to critisize my Spring frameworks project

19 Upvotes

Hello guys, I just finished my very first project in Java spring. Now I want to know which parts are bad really bad to improve them in next projects. Which practices should I avoid and which should I use instead. Also give some recommendations what learn next.

Also I'd like to ask is java spring good enough for not huge projects? Something like a forum or a simple online game like "a dark room".

Thank u in advance.

Here is my project: https://github.com/MonkiMonki10/blog


r/javahelp • • Dec 15 '20

what does public static void main(String[] args) mean??

19 Upvotes

I know, i Know, i might be the most stupid person on this community, but i just started studying java 2 days ago and I'm seeing this everywhere. can someone please explain this in a language that dum dums like me can understand? thank you in advance.


r/javahelp • • Dec 12 '20

How do I master Java Streams/Functional Programming?

19 Upvotes

I was asked to count occurrences of each characters in a String using Java 8 Stream API and although I know basic operations in Streams I would have never guessed the following Collectors.toMap() solution;

Collectors.toMap(k -> Character.valueOf((char) k.intValue()),
		                v -> 1,         
		                Integer::sum)

How, and from where, do I learn such declarative functional programming so that I can know when to use what by looking at the problem?


r/javahelp • • Dec 11 '20

I'm so lost on this, I don't even know where to begin. I feel like u need arrays for this, but we haven't been taught that yet. Could somebody please help? I'd really appreciate it.

19 Upvotes

I don't want the solution, I just want to know how I could start this off. For this assignment, you can only use while loops.

Write a program that asks the instructor for the number of students in the class. Then the program asks for students’ names and grades. Afterward, the program should print the name and grade of the student with the lowest grade.


r/javahelp • • Dec 09 '20

Should I really learn hibernate?

19 Upvotes

I am core java developer and had internship before using Spring boot to create rest api. I am also developing my own projects using boot and I really never had to know about Hibernate because Spring perfectly abstract database operations via JPA and we can handle every database operations without knowing what is in the background. So, should I really need to learn hibernate?

Can you give me scenarios where I should know about hibernate using Spring boot?


r/javahelp • • Dec 05 '20

AdventOfCode Advent Of Code daily thread for December 05, 2020

19 Upvotes

Welcome to the daily Advent Of Code thread!

Please post all related topics only here and do not fill the subreddit with threads.

The rules are:

  • No direct code posting of solutions - solutions are only allowed on source code hosters, like: Github Gist, Pastebin (only for single classes/files!), Github, Bitbucket, and GitLab - anonymous submissions are, of course allowed where the hosters allow (Github Gist and Pastebin do). We encourage people to use git repos (maybe with non-personally identifiable accounts to prevent doxing) - this also provides a learning effect as git is an extremely important skill to have.

  • Discussions about solutions are welcome and encouraged

  • Questions about the challenges are welcome and encouraged

  • Asking for help with solving the challenges is encouraged, still the no complete solutions rule applies. We advise, we help, but we do not solve.

  • No trashing! Criticism is okay, but stay civilized.

  • And the most important rule: HAVE FUN!

/u/Philboyd_studge contributed a couple helper classes:

Use of the libraries is not mandatory! Feel free to use your own.

/u/TheHorribleTruth has set up a private leaderboard for Advent Of Code. https://adventofcode.com/2020/leaderboard/private/view/15627 If you want to join the board go to your leaderboard page and use the code 15627-af1db2bb to join. Note that people on the board will see your AoC username.

Happy coding!


r/javahelp • • Nov 29 '20

How does the message get received by frontend? [Websockets]

19 Upvotes

Beginner learning websockets with java (spring boot) with reactjs. And I found this example on how to use websockets and it's like 90% clear on what's happening. The only thing I don't understand is how/where the frontend is receiving the response-message from the backend.

Link: https://www.opencodez.com/java/simple-websocket-application-springboot.htm

I kinda understand something happens here

stompClient.subscribe('/chat/sendMessage', function (greeting) {
            showMessageOnPage(JSON.parse(greeting.body).message);
        });

but does it mean that the showMessageOnPage-function gets triggered automatically whenever it receives a message that gets send to '/chat/sendMessage'?

Extra: I also looked at the documentation for STOMP https://stomp-js.github.io/stomp-websocket/codo/extra/docs-src/Usage.md.html where they use call-back instead of, but it seems that the chat-tutorial doesn't have an if-else.

(I'm gonna post this on a javascript sub because the precise question lies in Javascript, my bad)


r/javahelp • • Nov 26 '20

I just don't understand

19 Upvotes

Bit of an open ended question here but I'm at my wits end, I come from a background of 7+ years programming in c#, Javascript and python so I thought "I'll try out some Java", started a small project, got it running, happy days. I realised Java was pretty similar to what I already knew so decided to make something I'd actually want to use and here's where the problem begins.

I've tried creating an android app which after 2 days of trying to get the blank template to run using both Android studio and intellij I gave up because I couldn't even start writing code.

Now I'm trying to create a plugin for a game I play, I generate a template from their git (it's pretty basic, just a test project that loads their client and injects my project), follow all the instructions and get hit with a "Main method not found" error, I spend 2 hours debugging and trying to get it working to no avail, I've messed with module settings, sdk versions, reinstalling intellij, invalidating the cache, I can't get it to run at all and yet clearly it works since tonnes of people have made plugins, am I missing some fundamental knowledge of Java required to just get shit to work or is this just me?

(I've probably tried to create around 4-5 different projects in Java only for them to have all been halted by some sort of undiagnosable compiler issue)


r/javahelp • • Nov 11 '20

Help With Creating an Automating GUI Personal Project

19 Upvotes

I want to create a program that takes and analyzes screenshots, and simulates mouse clicks/movments. The inspiration came from Code Bullet and his " X Perfect AI" videos.

The issue is that the recent videos that I watched use Python, specifically the PyAutoGUI module. I personally do not prefer Python and I am much more comfortable with Java so I want to create my project in Java.

I understand that a Java.awt.Robot class exists and might serve what I want. However, this class is old (my feeling at least) and not pleasant to use.

My question is: does a (preferably high-level) Java library exist to interface with mouse and keyboard?

I am also open to a change in my strategy. Maybe it is better to only do part of the project in Java and use something like AutoHotkey. Any input is appreciated.

P.S: Not really related to the issue at hand, but I am actually planning to use Kotlin for this project as I wanted to learn the language. Does Kotlin provide more options for what I want to accomplish?


r/javahelp • • Nov 02 '20

Should I master Data Structure & Algorithm before jumping programming?

19 Upvotes

Should I master Data Structure & Algorithm before jumping into programming with Java or any other languages?