文字列入力を分割するために分割を使用しています。最初の 3 つは文字列ですが、最後の入力は double です。文字列分割が結果[4]をArrayListのdoubleに渡すことができるように、これを機能させるにはどうすればよいでしょうか?
Scanner catin = new Scanner(System.in);
System.out.print("Enter the Name, Breed, Color, and Weight of the Cat: ");
String test = catin.nextLine();
String[] result = test.split(",");
Cat c4 = new Cat(result[1], result[2], result[3], result[4]);