Jump to content

save data after close the program

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
eman ahmed

eman ahmed

    Learning Programmer

  • Members
  • PipPipPip
  • 79 posts
I requested from me a program to implement a registration system of university
If I run a program I will add some students with specific name to the university (added in linked list)
my question is how to make this program save this students after close the program .
I meant after clos the program and run it again , I want the students who added in linked list become stil in it.

#2
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
You have to save them into a file. write them to the hard disk. After reopening you must read them from the file and place back to your linkedlist.

Have you tried reading some book about Java? You are asking lots of trivial questions.

#3
Generic

Generic

    Newbie

  • Members
  • PipPip
  • 26 posts
        Runtime.getRuntime().addShutdownHook(new Thread() {
            public void run() {
                // Logic to save list here.
            }
        });
Not a guarantee that it'll save. Read documentation for more info.