r/learnjava • • Jul 14 '20

A Spring REST and H2 database application on the Raspberry Pi

48 Upvotes

The “Pi” in the name of the Raspberry Pi refers to Python, but as a Java developer I love to know and experiment with the various Java frameworks I also use at work. Spring is the main one, and I wanted to develop a proof-of-concept application that provides REST API’s to store and retrieve sensor data with a database back-end on the Raspberry Pi.

Read the full article on https://webtechie.be/post/2020-07-13-spring-rest-h2-raspberry-pi/


r/learnjava • • Jun 16 '20

Why does the main method have to be static in Java?

48 Upvotes

I understand we have static method when they belong to the class and not to the instance of the class. I also read how the runtime JVM will automatically will call the class with the main method on for you to invoke the program. In that case why did not the Java designers not simply just make the main method non static and invoke it by making an instance of object? Is there an actual concept or reasoning behind it that I am missing?


r/learnjava • • Dec 23 '19

[Beginner] Looking for a small project to join

48 Upvotes

Hello,

I believe that the best way to learn is just to practice. So, I thought that maybe someone here already runs or is about to run some project I could join. My intention is to make even the easiest job, but still coding and gaining experience. I'm during "Java in-depth" course on udemy and it seems to be good, but I feel like I miss a lot by not getting practise enough.

I'd be thankful for answers.


r/learnjava • • Jul 27 '19

Is there a difference between declaring an Arraylist with List<> and with ArrayList<> ?

48 Upvotes

I learnt it as the latter and hadnt seen the first one until recently. I was trying a Leetcode question where the return type was given as List<Integer>. Returning an ArrayList which was declared using ArrayList<Integer> gave me a compilation error. So whats the exact difference between the two?


r/learnjava • • Jul 01 '19

I'm quite slow at solving problems and it is kind of worrying me.

48 Upvotes

I'm extremely slow at understanding problems and developing solutions for the problems.For example the easy level problems in Hackerrank on an average takes me 1-2 hr to complete.I cannot understand how to improve my time.


r/learnjava • • Mar 27 '19

What books whould a junior java devloper should read to level up?

48 Upvotes

Say I am working as a junior java developer. Can someone provide me a list of "must-read" books that contain knowledge that is required to level-up to mid-level.


r/learnjava • • May 31 '25

Best Online Course for Java?

47 Upvotes

I just finished my 1st year and now I wanna learn Java from scratch and hopefully do DSA in it. Please suggest best courses on Udemy or Coursera for the same.

Bonus Points if it's FREE (I'm a college student so kinda broke lol)

If you could kindly give the roadmap along with resource link I'd be very very grateful🙏🏻


r/learnjava • • Jan 08 '25

After 6 months of java and springboot. I finally completed by mega project's backend. (the project that i initially had in mind)

47 Upvotes

Ask me anything and if you are interested , feel free to contribute. The frontend is not complete yet but backend through springboot is 98% complete. Feel free to drop suggestions and ask anything you did not understand in the repo. If you found it helpful. Give a damn star. Thank you. Repo Link. Go under Github-Repository-Management-System for the files.


r/learnjava • • Jun 01 '22

After finishing Java MOOC I & II and DSA, is it fine to start learning Spring / Spring Boot?

47 Upvotes

yo. I just finished University of Helsinki's Java MOOC I & II. I think I absorbed the material pretty well as I now understand and can code using OOP principles.

I'm going to take the Algorithms course of Coursera right now. After that, is it viable to jump into spring / spring boot? I'm afraid if there are knowledge gaps in my learning. Thanks!


r/learnjava • • Jun 04 '21

Why Generics? What is the point of it?

47 Upvotes

If I can have an untyped list, why do I need generics?

Python's list can hold any type and they do not seem to have the generics problem. Why does Java need it?


r/learnjava • • Apr 24 '21

Transitioning from minecraft development to general java, where should I start?

47 Upvotes

I have been developing minecraft plugins / mods for the past 1,5 years but now want to move away from minecraft and more towards general Java if that makes sense. Due to my previous experiences using java while making minecraft plugins I would not consider myself a beginner but I am not completely sure where I do fall in the spectrum since most of my experience was while using an api. I do know my way around enums, (abstract) classes, interfaces, variables, methods and most 'intermidate' stuff. Are there any tips on where I should start? And maybe some handy stuff to check out?

Thanks in advance!


r/learnjava • • Feb 04 '21

Is Java certification still worth it?

47 Upvotes

Hello.

This may be a dumb question, but is getting certified in Java still worth it?

What resources did you use to study? I’m thinking about going through Oracle, but I was wondering if there is somewhere else that teach it better.

I am in college right now learning Java. My skills probably won’t do me any good in a technical interview. I want to learn more outside of school, but I also want it to go to something like a cert to kill 2 birds with one stone.


r/learnjava • • Feb 02 '21

Which one of these courses is better to learn in the next three months?

47 Upvotes

My new job will mostly use Java and im trying to learn it in the next three months.

  1. This course i about 80 hours long. It takes me forever just to get through a 30 hour udemy course so im afraid about that. Also do i even need to know Java that in depth?

  2. This one is only 17 hours long.

Do you think i should do 1 only, 2 only, or finish 2 and then go in-depth with 1 if possible? I have already bough both btw


r/learnjava • • Nov 12 '20

For anyone working in the IT field or Software Development field

47 Upvotes

I'm currently taking courses for IT Software Development Bachelor Degree (1.5 years left) that comes with a certificate for software development.

How did you gain experience for your career? What are some tips to help get a job once I graduate? Did you build a portfolio? If you did, how? I'm not sure where or how to start. What are some good starting jobs? I feel like gaining a degree is just the bare minimum, and I'm not going to be able to get a job with just that. I want to explore what language is best for the job market, and what certifications would benefit most.

I've just started taking a java course, and python course, and I'll soon be working with C/C++ and more.

I work full time, mom full time, and going to school full time, so intern positions or co-op positions may not be an option for me.

Any feedback would be great! Thank you in advance.


r/learnjava • • Aug 04 '20

Open Source Spring Boot Projects

47 Upvotes

I have been learning Spring Boot lately and gotten the hang of it. I understand what Spring Boot is about and created a couple of small projects on my own to aid in my learning.

I think the next step in my learning to observe Spring Boot in an actual production environment. Even though I may know how to use some of the functions or annotations and it is working correctly but I'm not sure if I am following the best practice or the correct convection.

Does anyone know of any open source spring boot projects I can dig around and look through, understand the architecture or how it was build and learn more from it.

Perhaps this might not be the next correct thing in my learning, any suggestion is much appreciated!


r/learnjava • • Aug 29 '19

I'm looking for a competitive programming buddy for Java.

47 Upvotes

I'm a final year CS student who has recently gotten into competitive programming. I can program in Java, C++ and I'm a newbie in Python. I usually solve CodeChef problems but I'm in for solving other ones too. I just wish I could brainstorm about the problems with someone. If you are interested, please let me know. Thanks :)

Edit: I've created a Discord group! https://discord.gg/rHC3DgJ


r/learnjava • • Jul 07 '19

My very first Java / Raspberry Pi project is almost complete!

47 Upvotes

Been learning Java for a month now and I almost have my first project completed. It's an automatic plant watering system using a Raspberry Pi with a relay controlled water pump and a soil moisture sensor. The README.md in the git explains more. I'm just having a couple small problems with getting the pi4j library integrated into my project - a serious noob problem I know, but hence, I am a noob - any help here would grant you much karma.

here is a link to my github: https://github.com/jayJavaGGDev/autoWaterPlantSystem0.git

any help would be greatly appreciated.

edit:

&& pix or it didnt happen

https://imgur.com/eoq4T8X

https://imgur.com/GOiGUvB

https://imgur.com/mSOpL9d

https://imgur.com/EOcHRBL

edit 2:

if you're wondering I was able to use Runetime.getRuntime().exec("path to bashfile"); to point my java timer program to a bash file that runs sudo python turnOn.py and one for turnOff, which are just 4 line scripts that turn on and off the pins except I think my relay might have been damaged because it's not turning on at all! of course this method isn't going to work to get input from my moisture sensors...

edit 3:

july, 8 11:52 am.

after a day of debugging my code and wiring i discovered that i hadn't shorted out my relay after all. somewhere along the lines i had set my pinout to bcm and not updated my relay pin code from board... highly embarassing!

So I've gotten my java code to run on my pi and call a bash script that runs the python script to turn on and off the pins. but the problem is i have two separate python scripts for on and off and when my java code executes the powerOn.py file, the gpio gets turned on but the program stays running forever then pumpOff.py is executed and they both run simultaneously and the pin just gets turned on and off again until i reset the Pi.. help plz!


r/learnjava • • Jun 17 '19

It's time to buckle down and learn some programming.

47 Upvotes

I'd say for the past 5 years I've tried to learn programming off and on. Ever since I was a freshman in highschool, I've wanted to learn coding. I mean, I've always been a computer geek, mostly with the software side of things, since messing with hardware still scares the crap out of me (yeah yeah, I know, it's LEGOS for adults. But shits expensive, yo). Programming, to me at least, was always that next level goal. The one skill that would truly awaken me in some form or another.

The problem? Consistency and ADHD. You really don't want to know how many fucking times I cracked open some beginners programming book, sat down at my computer, completed a few chapters, and by the next day I would completely forget all about that ...Until about a week/month goes by and I want to start again. But hey, maybe python didn't do it and everyone says learning C is like learning Latin and every language afterwards is easier. Fuck it, load up some C tutorials. I mean, why spend time learning to program when I can spend that time picking the best text editor? Or spend 30 minutes sorting through color schemes? Oh yeah, Solarized Dark looks awesome on all this non existent code I have. Oh, and every new book I start gets less and less attention, since the basics I've already read from other books. Great.

So today, I'm changing all that. I'm gonna set some reminders and try and get a schedule going. I've already got an IDE, a PDF copy of Head First Java, and some ADHD meds. Why Java, you might be wondering? Well, I think my local community college starts with that, and if I go in for CompSci like I've been planning to do since Highschool...At least I'll have a bit of a head start in one way or another. Also, I've started and forgotten so many Python books...I just can't do it. Yes, the language is easy, but for me...it might be too easy, if that makes any since. I always get a few chapters in (you know, what a variable is, what strings are, etc) and just lose interest since it's the same stuff I've read countless times...

If any of you guys have similar problems to me, if you can offer any advice on what I'm going through or a different subreddit to post this tangent in, it would be appreciated. Oh, and thanks for reading.

TL;DR - Bad ADHD, wanted to be a programmer since Highschool, always get off track and start over with different books/languages.

EDIT: Notes update


r/learnjava • • Apr 25 '19

JavaFX tutorial - creating a simple 2D game

47 Upvotes

Hello guys! If you are interested in learning how to create desktop applications using javafx I encourage you to take a look at my youtube video tutorial where I show you how to create a simple 2D game :) have fun!


r/learnjava • • Jan 13 '19

I made a Twitter bot for downloading videos

47 Upvotes

I started learning Java 3 months ago and I am happy to share my project.

Twitter makes it difficult to download videos or gifs on its platform so I made a bot with to do so.

You can find the bot at https://twitter.com/GetVideoBot

How it works

  1. User finds a tweet containing a video or gif.

  2. User mentions @GetVideoBot in a reply.

  3. The bot replies with a link to download the video.

The video are fully hosted on twitter. It makes use of the twitter API to fetch the download link.

I created the bot using Twitter4j library and SQLite to store the tweet id’s to prevent duplicate response.

It is open source. The source code can be found at https://github.com/Philipinho/GetVideoBot .

Just a basic project for a java noob.

Your feedback and suggestions will be appreciated.

Thanks.


r/learnjava • • Nov 14 '18

How to fix your Java learning: a story of the Java tutor

47 Upvotes

r/learnjava • • May 15 '18

Was provided a coding challenge for a potential jobopportunity. Was rejected based on the code. Looking to improve.

47 Upvotes

As described above, I was asked to complete a coding challenge to proceed to the next round. I have 2 years of professional experience in developing web applications using the Java stack.

The problem seemed simple enough, you can see the problem and my solution on my Github: https://github.com/darshitpp/RealTimeStats

I was however rejected as I fell short of what they expected from a candidate. I asked for specific feedback, and they obliged.

This was our Developer's feedback:

  • Low Test coverage

  • No Constant memory

  • Side effects in the verify method

  • Recalculating max over entire list of transactions on every add, taking too much time

I admit there are some mistakes I made, namely

  • Low Test coverage

This was the first time that I wrote tests (mainly because we never write Automated tests in our org and I never learnt it any time). My question here is how to determine your test coverage for an API? I also had difficulties in learning how to write tests for the API using JUnit. What to test? What not to? And how to test? Can anyone point me to some resources to read up on this?

  • No Constant memory

They were asking for a constant memory implementation for the GET method, and I did it using an ExpiringMap and static variables (please see my github). I couldn't have done it better. Maybe I misunderstood something?

  • Side effects in the verify method

I can re-check this myself, but it there is something out of the ordinary, please suggest where I'm wrong.

  • Recalculating max over entire list of transactions on every add, taking too much time

The approach I took for calculating the max was the best I could think of, since the transactions constantly expire after 60 seconds. Calculating max by storing the previous max value would have been not reasonable as transactions expire.

Anything else I should look out for and things I should keep in mind for the next time I encounter a coding test from a company?

My org doesn't follow the best practices they should, so it's very probable that I've missed something obvious to people from other companies. My confidence as a good programmer has taken a beating. Learning by asking is the only thing I can do at the moment.

Thanks for all your help.


r/learnjava • • Jan 30 '25

Are lambda expressions worth learning? Are they widely used?

46 Upvotes

I've been 4 months now in my programming course, mainly Java, and professor told us not to bother with them and that they are deprecated. Idk, at first glance they seem to be more optimal sintaxys-wise and all. What's the opinion of the veterans on this regard?


r/learnjava • • Jan 08 '25

Taking my Java to the next level (advanced)

46 Upvotes

I've been programming in Java for over 4 years now and have reached what I believe to be an intermediate level (I will elaborate on what I know, so in case I'm wrong about this, you all can ground me/level me out)

My knowledge: OOP, Collections, Generics, exception handling, file i/o, basic lambdas (using lambda syntax, none of the fancy interfaces), concurrency (threads, runnables, synchronized keyword, locks, basically all basic concurrency primitives in java, wait/notify/notifyAll etc.), Java streams (basic streams), design patterns (Singleton pattern,Factory pattern, Observer pattern), JUnit (I know less syntax than I do conceptual stuff because a lot of what I learned about testing software was through Jest with Javascript), byte communication (RMI, sockets/socket channels, bytebuffers, blocking queues, serialization, etc)

EDIT: It seems I may have come across stronger than I appear. All of this stuff is within my conceptual knowledge, probably quite a bit more syntax than I would like to admit I haven't internalized yet (such as sockets/socket channels, some streams, maybe some file i/o)

My question: what can/is valuable to learn more about? Any books/resources you recommend in particular?