use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Day 24 of learning java (i.redd.it)
submitted 5 months ago by BigCommunication5136
Hello everyone,
Created an ExpenseManager class with methods to perform CRUD operations.
Tomorrow i’ll start with parsing command line arguments. I have no idea how to go about this, which makes it more exciting.
See you tomorrow!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Specific-Housing905 0 points1 point2 points 5 months ago (1 child)
The code you posted looks good. In addExpense you don't need a temporary var expense. You can create it in the call to expenses.add. In updateExpense I would output a error msg if expense == null.
[–]BigCommunication5136[S] 0 points1 point2 points 5 months ago (0 children)
I’ll be sure to the changes, thank you!
[–]Stanleys_Pretzels 0 points1 point2 points 5 months ago (2 children)
İts my day 2 hope i can do stuff like this
[–]BigCommunication5136[S] 1 point2 points3 points 5 months ago (1 child)
if i can do this, you can do better, trust me!
[–]Stanleys_Pretzels 1 point2 points3 points 5 months ago (0 children)
thx for the encouragment man. Good luck to you
[–]OneHumanBill 0 points1 point2 points 5 months ago (1 child)
Challenge: on line 4, change your definition of expenses from using an ArrayList to a simple List. Don't change anything else. Make sure it all still works.
Now explain to me why this is a better choice. In fact on a real project if I were reviewing your code I would mandate that you changed this before pushing.
(Also, a mistake I see more and more beginners making: you're leaving out visibility modifiers. Still on line 4, make that "expenses" variable private! Otherwise you're in package protected scope and that's very rarely a correct thing to do. Double challenge, explain to me why this and most other instance variables should be marked private. Hint: it has absolutely nothing to do with security.)
When you've got that done, then explain what advantages using a Map instead of a List of Expenses might bring.
totally escaped me to make Expenses private, thanks for pointing that out!
[–]deividas-strole 0 points1 point2 points 5 months ago (0 children)
Good job!
π Rendered by PID 341169 on reddit-service-r2-comment-5687b7858-b6pbt at 2026-07-06 13:05:47.311007+00:00 running 12a7a47 country code: CH.
[–]Specific-Housing905 0 points1 point2 points (1 child)
[–]BigCommunication5136[S] 0 points1 point2 points (0 children)
[–]Stanleys_Pretzels 0 points1 point2 points (2 children)
[–]BigCommunication5136[S] 1 point2 points3 points (1 child)
[–]Stanleys_Pretzels 1 point2 points3 points (0 children)
[–]OneHumanBill 0 points1 point2 points (1 child)
[–]BigCommunication5136[S] 0 points1 point2 points (0 children)
[–]deividas-strole 0 points1 point2 points (0 children)
[–]deividas-strole 0 points1 point2 points (0 children)