how can we Combining both statements into one?

class Animal {
public Animal(String aType) {
type = aType;
}
public String toString() {
return "This is a " + type;
}
private String type;
}
public class MainClass {
public static void main(String[] a) {
System.out.println(new Animal(“a”).getClass().getName()); // Output the class name

}
}

output
Animal