Advertisement
Guest User

Untitled

a guest
Jan 25th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. package com.javarush.test.level20.lesson10.home05;
  2.  
  3. import java.io.*;
  4. import java.util.logging.Logger;
  5.  
  6. /* Сериализуйте Person
  7. Сериализуйте класс Person.
  8. */
  9. public class Solution{
  10.  
  11. public static class Person implements Serializable {
  12. String firstName;
  13. String lastName;
  14. transient String fullName;
  15. transient final String greetingString;
  16. String country;
  17. Sex sex;
  18. transient PrintStream outputStream;
  19. transient Logger logger;
  20. private static final long serialVersionUID = 123456789;
  21.  
  22. Person(String firstName, String lastName, String country, Sex sex) {
  23. this.firstName = firstName;
  24. this.lastName = lastName;
  25. this.fullName = String.format("%s, %s", lastName, firstName);
  26. this.greetingString = "Hello, ";
  27. this.country = country;
  28. this.sex = sex;
  29. this.outputStream = System.out;
  30. this.logger = Logger.getLogger(String.valueOf(Person.class));
  31. }
  32. }
  33.  
  34. enum Sex {
  35. MALE,
  36. FEMALE
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement