Use this cheat sheet for the exercises.

  1. Create a ClassInspector class. This class should have a inspectClass method. The method receives one Object argument, and prints out the type of the received object.

  2. Create an Analyzer class. This class should also have a method that receives an Object. It should output the following.

  3. Advanced. Create a Runner class that has to methods.

  4. Create a Serializer class. This class should be able to serialize and deserialize objects.

    The serialize method should receive an Object and an OutputStream. If the object is a BigInteger, it should write out its bytes using the toByteArray method. If it is not a BigInteger, it should serialize each field.

    The deserialize method should receive a Class object and an InputStream. If the class object is BigInteger.class then the method should deserialize the BigInteger using its constructor. If it is another class it should create the new object and deserialize and set each field.

  5. Continue with the previous exercise. Create a DontSerialize annotation, that can be used on fields. When there is such annotation on a field then it should not be serialized or deserialized.