역직렬화: 객체복구

FileInputStram fileStream = new FileInputStream("MyGame.ser"); //file지정

ObjectImputStream os  = new ObjectInputStream(fileStream);//get Object

Object one = os.readObject();
Object two = os.readObject();
Object three = os.readObject();

GameCharactor elf = (GameCharactor) one;
GameCharactor troll = (GameCharactor) two;
GameCharactor magician = (GameCharactor) three;

os.close();

댓글

이 블로그의 인기 게시물

누가복음 16장 1절~13절

누가복음 11장 9절 ~ 13절