What doesn't this code work?
I've been trying to make a program with multiple user inputs, but I get a bunch of errors when I try to run it. The code is supposed to get the users input on what animal to name(dog or cat) and then based on that they will be able to either name a dog or a cat and get a message. Here's the code: import java.util.Scanner; public class Animal { public static void animal(){ Animal animal = new animal } public static void whichAnimal(){ Scanner dogorcat = new Scanner(System.in); String animal= dogorcat.nextLine(); } public static void catName(){ Scanner name = new Scanner(System.in); System.out.print("Meow! My name is "+ name.nextLine()+"."); Animal Cat = new Animal(); } public static void dogName(){ Scanner name = new Scanner(System.in); System.out.print("Bark! My name is "+ name.nextLine()+"."); Animal Dog = new Animal(); } public static void main(String[] args){ dogorcat.whichAnimal(); if(string animal = "cat"){ Cat.catName(); } else{ Dog.dogName(); } } }