Why must I go to help section to figure this out?
Furthermore, why does this print 3x Cat, Dog, etc?
package com.codegym.task.task12.task1204;
/*
Whether it's a bird or a lamp
*/
public class Solution {
public static void main(String[] args) {
printObjectType(new Cat());
printObjectType(new Bird());
printObjectType(new Lamp());
printObjectType(new Dog());
}
public static void printObjectType(Object o) {
//write your code here
o = new Cat();
System.out.println("Cat");
o = new Bird();
System.out.println("Bird");
o = new Lamp();
System.out.println("Lamp");
o = new Dog();
System.out.println("Dog");
}
public static class Cat {
}
public static class Dog {
}
public static class Bird {
}
public static class Lamp {
}
}