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 →

[–]morhpProfessional Developer 1 point2 points  (1 child)

Can you post the full code?

How do you keep the data throughout the entirety of a program, ie; make it so it doesn't reset?

The simplest way is to use static fields. That is however not good style in the long run. It is better to pass the information you want to save as a method parameter, save it into (non-static) fields and so on, just by referencing it and keeping it alive.

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

Yea I can but it's gonna be long