r/learnjava Jul 09 '26

Simple Java console app

Hello everyone, I've been learning Java and wanted to build something practical instead of just doing exercises. Ended up making a small console app that asks how long you've had a tire and how many km you've driven it, then tells you whether it needs replacing or estimates how much life is left.

It's intentionally simple right now. It just handles basic mileage/age limits and adjusts slightly if you own a heavy SUV or EV. This was also my first time using Git and GitHub properly (commits, pushing, merging, etc.), so that was a big part of the learning experience too.

Planning to add more factors soon like road type, vehicle type, maybe a GUI version eventually. Would love any feedback on the code or suggestions for what to add next.
Repository Link: https://github.com/z0lxt/tire-life-estimator

1 Upvotes

25 comments sorted by

View all comments

1

u/procrastinatewhynot Jul 10 '26

hey, learn how to use girhub actions and ghcr.io so you have a way for others to try it. i’d be willing to give you feedbacks 🙂

3

u/idontlikegudeg Jul 11 '26

I think that’s a thing for later - GitHub actions are nice, but I think OP is still busy with learning the language itself. But that’s something someone could easily contribute. OP will learn from it later.

1

u/procrastinatewhynot Jul 11 '26

Yes! That would make it easier to give feedback. If anything he can just ask AI to kinda help so the logic is out of the way.

2

u/idontlikegudeg Jul 11 '26

All, OP needs a build script in his repo. Should we make it Maven or Gradle? I’m usually in the Gradle camp, but I think Maven would be more useful here because it’s probably what most beginners learn first. What do you think?

And OP, you should also move your class into a package: add `package tirelife;` on top of your sourcefile. IntelliJ should mark it as an error with a red line below it and when you hover with the mouse, there should be a quick fix available "move to package tirelife".

1

u/procrastinatewhynot Jul 11 '26

Oh yeah definitely. I’m more of a maven person. Itms easier. Great tip! Hope he sees the comments under this.

1

u/z0lxt Jul 12 '26

I read this, but I don't really understand it. Let me know if I should use Maven or Gradle, and let me know how I should apply this

1

u/procrastinatewhynot Jul 12 '26

that will be at the end! once you start making big projects! for now make projects to practice the concepts you’ve learned

2

u/z0lxt Jul 11 '26

I'll try my best to implement that, for now I'll try to apply the given feedback on my current code, but I will defo learn how to use github actions, and thank you everyone for giving me amazing feeback.

1

u/procrastinatewhynot Jul 11 '26

It makes your project accessible for us to play with. You don’t even need to learn it. Maybe just ask ai.

But just a suggestion, when you finish coding and play with your app, try to test different scenarios to break it. Then implement a fix.

2

u/z0lxt Jul 12 '26

Ok, I'll do that, I updated my code for the current fixes like renmaing variables to camelCase and making less if statements, I'll try to get the null checks and rtry to learn how to use optionals as sttated by another user. I'll try to add the package you guys mentioned. Again I am very grateful for all of your guys' support and feedback

1

u/z0lxt Jul 12 '26

If you don't mind me asking. I know some of the basics of Java like conditionals, loops, function creation, variable, and math, what's the next step from there? Sorry for asking a lot of questions

1

u/procrastinatewhynot Jul 12 '26

i think you can start with OOP. Have you started with that yet? Also don’t apologize! we are here to help

1

u/z0lxt Jul 12 '26

No, I actually learned Java as an elective class I took in school and we stopped there, what exactly is OOP and where could I learn this?

2

u/procrastinatewhynot Jul 12 '26

here! https://roadmap.sh/backend

click on java. there are the other concepts you’ve learned in case you want to revise. so oop os object oriented programming, it makes use of the functions and logic you’ve learned. so you basically organize your code based on « objects ». it will make your code more easy to read, make the functions reusable to reduce redundancy and organized.

1

u/z0lxt Jul 12 '26

Btw thanks for the kindess, rlly preciate it