can anyone see my error?

error output

error: ';' expected
System.out.println((GoldFish)owner.pets[ 9 ]).getAction("Rat eats alot" ));
^

    owner.pets[ 9 ] = new GoldFish();
    Pet BlackMoor = owner.pets[ 9 ];
    System.out.println((GoldFish)owner.pets[ 9 ]).getAction("*Rat eats alot*" ));
Member Avatar for michelleradu

try this System.out.println(((GoldFish)owner.pets[9]).getAction("*Rat eats alot*"));

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.