The way i see it you have the following two issues with your posted code:
- There is no import for Toy class in your code. Add that import statement so that java knows what to do with it.
- Also there are two extra closing curly braces in the end.
solved Why am I getting an error in my Java code? [closed]