Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.test.level20.lesson10.home05;
- import java.io.*;
- import java.util.logging.Logger;
- /* Сериализуйте Person
- Сериализуйте класс Person.
- */
- public class Solution{
- public static class Person implements Serializable {
- String firstName;
- String lastName;
- transient String fullName;
- transient final String greetingString;
- String country;
- Sex sex;
- transient PrintStream outputStream;
- transient Logger logger;
- private static final long serialVersionUID = 123456789;
- Person(String firstName, String lastName, String country, Sex sex) {
- this.firstName = firstName;
- this.lastName = lastName;
- this.fullName = String.format("%s, %s", lastName, firstName);
- this.greetingString = "Hello, ";
- this.country = country;
- this.sex = sex;
- this.outputStream = System.out;
- this.logger = Logger.getLogger(String.valueOf(Person.class));
- }
- }
- enum Sex {
- MALE,
- FEMALE
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement