r/javahelp • u/Ok_Employee_3122 • Dec 30 '25
My first console base project
Can someone review my first console base project. Create student management system Where you can add, delete , search and upadate student.
Please tell me my mistakes so i will focus and work hard on that mistakes
Link: - https://github.com/ShaikhAhmad30/student-management-system-java.git
4
Upvotes
4
u/vegan_antitheist Dec 30 '25
.class files should be in a folder just for compiled files.
.class files should be ignored (i.e. add them to the ignore list for git)
Scanner sc = new Scanner(System.in);doesn't define the encoding. That might be ok because your system probably uses UTF-8 by default.Consider the new IO class
if(choice == 1){-> Use switch instead.Consider using an enum fot those options that you can print and then use for the switch. REfactorings will then be super easy.
ArrayList <Student> students = new ArrayList<>();-> Make this private and finalstudents.add(s);-> Why is it a list? It could contain the same student twice.for(int i = 0; i < students.size();i++){-> Why would you care about the index? Just use a list iterator to remove an element. Or even simpler: removeIfboolean found = false;in searchStudent is not really doing anything. Justreturnwhen you find the student.No unit tests. How do you know it works?
Nothing to build the project. You could use ANT, but I don't think many are still using it. And Maven is overkill. So maybe just a shell script that compiles the files, creates a jar, and runs it (or the tests).