Cat cat8 = new Cat();
Cat cat9;
Cat cat1 = new Cat();
Cat cat1;
Cat cat2 = new Cat();
Cat cat2;
Cat cat3 = new Cat();
Cat cat3;
Cat cat4 = new Cat();
Cat cat4;
Cat cat5 = new Cat();
Cat cat5;
Cat cat6 = new Cat();
Cat cat6;
Cat cat7 = new Cat();
Cat cat7;
Cat cat8 = new Cat();
Cat cat9 = new Cat();
Cat cat10 = new Cat();
I am unable to understand this :(
Resolved
Comments (9)
- Popular
- New
- Old
You must be signed in to leave a comment
Maria Habib
15 September 2018, 07:19
com/codegym/task/task02/task0212/Solution.java:17: error: variable cat1 is already defined in method main(java.lang.String[])
Cat cat1;
^
com/codegym/task/task02/task0212/Solution.java:18: error: variable cat2 is already defined in method main(java.lang.String[])
Cat cat2;
^
variable cat1 is already defined in method main(java.lang.String[]):
Solution.java, line: 17, column: 14
0
Neha Anjum
15 September 2018, 07:24solution
Cat cat8 = new Cat();
Cat cat7 = new Cat();
Create 6 more objects like this with different name that will make total 8 of it
then last 2 should b done as Cat cat9; and Cat cat10;
that makes 10 :)
+4
Kunal Kushwaha
10 June 2019, 12:32
Shukriya samjhane ke liye
0
Maria Habib
15 September 2018, 07:16
it shows error in Cat cat1;
+1
Neha Anjum
15 September 2018, 07:17
what error are you getting..??
0
Maria Habib
15 September 2018, 07:13
ok ....
+1
Neha Anjum
15 September 2018, 07:11solution
Example
Cat cat8 = new Cat();
creat 7 more objects like that and give them different names
and then create only two variables
For example
Cat cat10;
+4
divya sayidasa naik
15 September 2018, 07:16
thank you
+1
Neha Anjum
15 September 2018, 07:17
Glad I could help :)
0