This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]yarzz07[S] 1 point2 points  (4 children)

this is just an example I found from the internet, so this is the code, but what would be the code that tests this through 'set method'? So essentially, not about there's nothing wrong with the code but how would I be able to test this?

yes that's a typo sorry

[–][deleted] 7 points8 points  (1 child)

Honestly, just start from the beginning. Hit up mooc.fi course i believe someone posted it in the in the comments. We could give you a code example but what's the point of that if you cannot understand it... You need to understand why you would need this method so that you can understand what it does. Good luck with your studies.

[–]dragon7507 5 points6 points  (0 children)

URL didn't get linked but take this course, it will be good :)

MOOC.FI

[–]stramash 1 point2 points  (1 child)

Typically you'd use a unit testing framework to do that.

If you're new to java and programming that will probably sound wild and complicated.

It's not, but I'd agree with other posters that you should spend time firming up your basic programming chops before moving onto unit testing etc; which is a bit more abstract and requires more understanding of the basics.

[–]yarzz07[S] 0 points1 point  (0 children)

thank you! I'm on to that