Notes
Notes - notes.io |
package com.example.qcscmis_hridoy;
import com.example.qcscmis_hridoy.MemberModel;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
public class MemberControler {
//creating new method for getAllmembers
public ArrayList<MemberModel> getAllmembers() {
ArrayList<MemberModel> memberList = new ArrayList<>();
MemberModel tempModel;
for (int i = 0; i < 5; i++) {
int id = memberList.size() + 1;
tempModel = new MemberModel("" + id, "member" + id, 1);
memberList.add(tempModel);
}
return memberList;
}
// Saving our MemberModel object ArrayList data into file
public void serializeMemberList(ArrayList<MemberModel> memberList)
{
try
{
FileOutputStream fout = new FileOutputStream("D:\quanta264.txt");
ObjectOutputStream out = new ObjectOutputStream(fout);
out.writeObject(memberList);
out.flush();
//closing the stream
out.close();
}
catch (Exception e)
{
System.out.println(e);
}
}
// Loading all MemberModel data from file
public ArrayList<MemberModel> getDeserializeMemberList()
{
ArrayList<MemberModel> memberList = null;
try
{
//Creating stream to read the object
ObjectInputStream in = new ObjectInputStream(new FileInputStream("D:\quanta264.txt"));
memberList = (ArrayList<MemberModel>) in.readObject();
//closing the stream
in.close();
}
catch (Exception e)
{
memberList= new ArrayList<>();
System.out.println(e);
}
return memberList;
}
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team