Lab 2: Constructors
1. Create a class called Dog with an overloaded bark( ) method. This method should be
overloaded based on various primitive data types, and print different types of
barking, howling, etc., depending on which overloaded version is called. Write a
main( ) that calls all the different versions.
2. Create a class Robot with three methods: Walk(double), where double is the distant
in meters, Turn(String), where string can be “Left” or “Right”. Within the first
method, call the second method twice: the first time without using this, and the
second time using this.
3. Create a class called Tank that can be filled and emptied, and has a termination
condition that it must be empty when the object is cleaned up. Write a finalize( )
that verifies this termination condition. In main( ), test the possible scenarios that
can occur when your Tank is used.