/r/learnjava
Resources for learning Java
Resources for learning Java
Format + Copy
, and paste the code in your post (remember to leave an empty line above the code!).Free Tutorials
Where should I download Java?
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Software downloads
Official Resources
Resources
Programming ideas & Challenges
Related Subreddits
/r/learnjava
the project: file (dot) io/G5LISDcFlH7s
Hi friends, here i have a disaster of a spring security setup. I really dont know what most of it is, ive been studying spring security for a week now and im still very lost. And even the error messages i get i dont really know what they mean (pastebin (dot) com/R10qV46U). Help :(
I am a software developer, and my current tech stack includes Node.js, NestJS, and TypeScript. Now, I want to learn Java and Spring Boot. Are there any good free resources that teach Java in-depth? Also, considering I already know C++ and JavaScript/TypeScript, how much time do you think it will take for me to become proficient in Java?
I believe sometime in the last 2 weeks there was a post on r/java with a link to a blog of someone previewing upcoming SpringBoot 3.4 features and talking briefly about each feature. Other posts on this blog were the person talking in-depth about how Spring loads properties and environment variables. I also believe there was a blog post about the recent Java 24 fixing the green threads issue with IO.
I was reading this post and was quite surprised at how detailed and informative it was. Miles above and Baeldung or Medium articles I had read on the same subject.
Unfortunately, I can't find this blog in my browser history, it seems to have been deleted from r/java, and Google's recent changes to search pretty much just pull any searches about SpringBoot 3.4 or the internals of Spring's property loading process into the same 4 or 5 Medium, InfoQ, or Baeldung articles, even when trying to tease out the wording to hit the specifics of the blog in question.
It seems really hard to find high quality blogs from individual developers that really know their stuff from Google alone.
Again a longshot, but if anyone knows of a blog (that seems to be written by one developer) separately covering: the recent SB 3.4 update features, Spring property loading, and Java 24 changes to threads then please link it below.
Worst-case scenario I guess we just get some links to other high quality Java/Spring blogs?
Hi,
I havethe following code. It has a button handler
Hi,
I got a program from ChatGPT. It has made a button handler inside the function "CreateBtns()". Kindly tell me is the button handler global or local?
Following is my code:
public class CreateBtnProg {
JFrame frame;
JButton[] button = new JButton[10];
JPanel panel;
String strInp="";
DoublyLinkedList objDLL;
public void CreateBtns() {
frame = new JFrame("Button Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1200, 200); // Increase frame width to fit all buttons
// Set the layout manager for the frame
frame.setLayout(null); // Use null layout to allow absolute positioning
buttonController.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// Action to be performed when the button is clicked
// Display a message in a dialog box
//Generate random numbers from 0-9
Random rand = new Random();
// Will work for [0 - 9].
int randVal= rand.nextInt(10);//This will designate the start node from where counting starts
:
:
}
});
}
public static void main(String[] args) {
CreateBtnProg obj = new CreateBtnProg();
obj.CreateBtns();
}
}
Zulfi.
Hi.
So instead of complaining like I did here. I decided to take action an actually code. I had this idea to make a Wordle in Java, and I did it with some struggle, but I did it.
I'm a beginner in programming, and I know that some people here will pull their hair off while reading the code, but I'll accept all criticisms from you guys in order to improve.
Here's the code : https://pastebin.com/8WrDJMfG
I have learned all the basic and other java features but i would like to learn hoe to make apps and java servers but i am got getting proper resources online so i would request You Guys to please recommend me some resources from where i can learn those
Im a 14 year old male and Im wanting to get into coding what website would give me the best bang for my buck?
Hi, I have a question. I've been learning Java on my own through documentation, yt, practices, and through mooc.fi but when I searched for information I realized that a lot of people recommend Tim Buchalka's Java Masterclass course. Some say it's okay at first and then his explanations go downhill. If any of you have taken it, could you tell me if it's worth it? Or if you have any other courses you recommend, which ones would they be?
Learn Java
Guys I'm planning to learn springboot from hyper skill. Is it really a good platform to learn from?. It kinda seems a bit complicated for me though but is it really worth spending my time for? I really want to know that coz I only have less time to study some technology and master it. Gotta do a project on it asap.!!
Is this for real that the Spring Data Mongo repository maps the entities based on the method name!!?
like you mean i can write List<User> findByLastNameHavingBalls(User) and it will work!!???
This is my first post on the learnjava reddit community so apologies in advance if I'm not following proper etiquete.
Some of the clients I work for, most of them from the financial industry, use Java for real-time low-latency systems. These are mostly trading systems that cannot afford the overhead of the garbage collector.
I made a YouTube video (https://www.youtube.com/watch?v=bhzv6lJtuOs) where I discuss this Java programming technique in detail, with an example of a Params
class that parses a line containing parameters, for example "aaa 123 bbb"
, without producing any garbage. It is basically using Java as a syntax language.
To make things more fun I also employed the help of our friend ChatGPT :)
What do you think about this garbage-free approach? Also any feedback/comment about the video would be appreciated. This is my very first video.
Thanks and Happy Thanksgiving!
I just compiled my very first JNI DLL. This means that XFrames can soon be used with languages that depend on the JVM. I'd have loved to use Java Foreign Function and Memory, but I couldn't quite figure out how to use it. Know anyone who's used it?
I was looking for Java material for beginners and the java mooc came up on some older reddit threads. Looking into it however, it turns out the course was updated recently but replaced entirely by Python.
The older course is still accessible via the URL for it but it's a little buried on their website now.
If this isn't the best place to start out anymore, where is?
I want youtubers paid springboot course for free. Can anyone provide me please.
Hello
I am looking for good learning resources, which also explain advanced concepts of Java such as interfaces, abstract classes, static/public/private/protected fields/methods, threads, race conditions, instances, data types etc.
I'm more interested in to reading stuff, I'm not good with online video courses and if possible I would things to be up to date with Java 21.
Thanks
hello everyone. not so long ago i started learning java. i want to make something in ASCII with infinite loop. "animation". is there any materials for it? thx.
The title kinda says it all, Im kinda new to java, it's very similar to c# (I modded unity games via bepinex and modifying dll with dnspy) I used lwjgl and it was a pain to use, I was following a tutorial using lwjgl 2 while I was using lwjgl 3, are there any good tutorial(s) for lwjgl 3 or a whole different library
/**********************************************************************************
* (The Account class) Design a class named Account that contains: *
* *
* ■ A private int data field named id for the account (default 0). *
* ■ A private double data field named balance for the account (default 0). *
* ■ A private double data field named annualInterestRate that stores the current *
* interest rate (default 0). Assume all accounts have the same interest rate. *
* ■ A private Date data field named dateCreated that stores the date when the *
* account was created. *
* ■ A no-arg constructor that creates a default account. *
* ■ A constructor that creates an account with the specified id and initial *
* balance. *
* ■ The accessor and mutator methods for id, balance, and annualInterestRate. *
* ■ The accessor method for dateCreated. *
* ■ A method named getMonthlyInterestRate() that returns the monthly *
* interest rate. *
* ■ A method named getMonthlyInterest() that returns the monthly interest. *
* ■ A method named withdraw that withdraws a specified amount from the *
* account. *
* ■ A method named deposit that deposits a specified amount to the account. *
* *
* Draw the UML diagram for the class and then implement the class. (Hint: The *
* method getMonthlyInterest() is to return monthly interest, not the interest *
* rate. Monthly interest is balance * monthlyInterestRate. monthlyInterestRate *
* is annualInterestRate / 12. Note that annualInterestRate is a percentage, *
* e.g., like 4.5%. You need to divide it by 100.) *
* *
* Write a test program that creates an Account object with an account ID of 1122, *
* a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw *
* method to withdraw $2,500, use the deposit method to deposit $3,000, and print *
* the balance, the monthly interest, and the date when this account was created. *
/*********************************************************************************/
import java.util.Date;
public class Account {
private int id;
private double balance;
private double annualInterestRate;
Account() {
id = 0;
balance = 0;
annualInterestRate = 0;
}
Account(int num1, double num2) {
id = num1;
balance = num2;
}
/**
* setters
*/
public void setId(int num) {
id = num;
}
public void setBalance(double num) {
balance = num;
}
public void setAnnualInterestRate(double num) {
annualInterestRate = num;
}
/**
* getters-dateCreated also has a getter
*/
public int getId() {
return id;
}
public double getBalance() {
return balance;
}
public double getAnnualInterestRate() {
return annualInterestRate;
}
public double getMonthlyInterest() {
return (balance * annualInterestRate / 1200);
}
public Date getDateCreate() {
return new Date();
}
/**
* withdraw method and deposit method
*/
public void deposit(double num) {
balance += num;
}
public void withdraw(double num) {
if (num > 0 && num < balance) {
balance -= num;
}
}
public static void main(String[] args) {
Account acc1 = new Account();
Date saveThisDate = acc1.getDateCreate();
acc1.setId(1122);
acc1.setBalance(20000);
acc1.setAnnualInterestRate(4.5);
acc1.withdraw(2500);
acc1.deposit(3000);
// balance
System.out.println("Balance is " + acc1.getBalance());
System.out.println("Monthly interest is " + acc1.getMonthlyInterest());
System.out.println("Date when the account was created " + saveThisDate);
}
}
I want to ask if I am solving the problems the correct way? Because these problems don't have solutions and are mostly a design problem. Am I designing them correctly?
Hi,
I have all the buttons in one line. How can I change the position of the "Controller" button in the following code?
package com.mycompany.createbtnprog;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.FlowLayout;
/**
*
* @author zulfi
*/
//https://stackoverflow.com/questions/52876701/creating-buttons-but-have-each-button-have-its-own-variable-name/52877094
public class CreateBtnProg {
JFrame frame;
JButton[] button = new JButton[10];
JPanel panel;
public static void main(String[] args) {
CreateBtnProg obj = new CreateBtnProg() ;
obj.CreateBtns();
}
public void CreateBtns(){
frame = new JFrame("Button Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600, 100); // Set the frame size
// Set the layout manager for the frame
frame.setLayout(new FlowLayout(FlowLayout.LEFT));
// Create a panel to hold the buttons (optional)
panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
// Create and add 10 buttons to the panel
for (int i = 0; i <= 9; i++) {
button[i] = new JButton("Button " + i);
panel.add(button[i]);
}
JButton buttonC = new JButton("Controller" );
buttonC.setBounds(60, 400, 220, 30);
panel.add(buttonC);
// Add the panel to the frame
//button locatiionhttps://stackoverflow.com/questions/16756903/how-to-set-the-location-of-a-button-anywhere-in-your-jframe
frame.add(panel);
// Make the frame visible
frame.setVisible(true);
}
}
Somebody please guide me.
Zulfi
when i try to run the main file the message appears " The screen cannot be set to the number of lines and columns specified." can you anyone tell me whats wrong i'm new to programming.
Hello Everyone,
As the title says, I am curious how everyone architects their app. I am interested to see how the overall file structure is. Such as do you have three main directories as Infrastructure, Domain, and Application? Do you have it app-based like Django?
I look forward to seeing what you have!
Could somebody please explain the reflection concept in java?
Can anyone help me learn aws?
Like where do I start with as a developer?
There are way to many things to learn about cloud, and I dont want to be a devops engineer and learn all sorts of things, i just want to pickup thing which are important as a developer, and other things i can pickup later if needed.
PN: My tech stack is Java and I would appreciate if I could get resources related to java so that I can pickup things faster
r/aws r/java
I have Users table in database, it has fuilds like: I'd, email(also works as usename), password, name, surname ext. For example user wants to change password (it's already login, I use JWT taken for that), I ask for write old and new passwords, if old password matches that one in database(I don't store row passwords), I just extract email from AuthenticationContestHolder, and change password where email = getted email. Or I need find ID, by email and only then make changes? I also make sure that email is unique
Do you guys have experience with the certification? Is it a benefit or unnecessary? I have been working with spring for the past 5 years and think about doing it to prove on paper that I actually can do it:D
https://www.broadcom.com/support/education/vmware/certification/spring-certified-pro
I've spent like 2 hours on this y'all. I followed all of MOOC's instructions on installing TMCBeans. Absolutely everything I do still leads me to "Apple could not verify “tmcbeans.app” is free of malware that may harm your Mac or compromise your privacy." Here's what I've tried:
I have tried every recommendation I have seen on this sub and on Google. Absolutely nothing works. I keep getting the same message no matter what I do. My employer wants me to take this course, so I am on my work laptop. I suppose that must be the problem? IT can't figure this out though. Since I'll be completing this at work, I'll need to be able to use my work laptop.
So... two questions. Anything else I can try? And if not or if nothing else works, have people successfully gone the VS Code route? I followed all of these steps and I'll be honest, I'm already struggling with the fact that the course's expected app is beans and the video/instructions reflect this. I'm a super beginner to programming and boy am I already so discouraged.
Can you brainstorm? I 've been learning java since last 1 year and idk what sort of projects could be resume worthy. i.e when do I know I am ready to apply and crack the job given a chance at interview.
Every time I start learning spring I get stuck at annotations parts! Pls suggest tips for learning annotations. List of mostly used annotations would be very helpful thank you.