Crazy eights

  • 1
The fact that cats were able to take over the Internet with ease shows that we are far from knowing everything about these cute balls of furs. The only obvious thing is that people without them are worse off than people with them. Let's make the world a better place: create 10 Cat variables and 8 more Cat objects. By the way, does anyone need a kitten?
You can't complete this task, because you're not signed in.
Comments(38)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
arjunbandaLevel 3 , Providence
13 June, 17:12
All you have to do is keep two variable of cat uninitialized and 8 initialized
MKLevel 4 , Singapore
9 May, 16:41
An object instantiated is also an object variable. So you don't need exactly 18 of them.
JennerinoLevel 3 , Rotterdam
12 April, 16:17
It took me sometime to figure this one out I must say, but after completing it I thought: really? We often think to complicated. Doing some reading again really made me understand the concept more of this task.
ROBORUDYLevel 2 , Milwaukee
11 March, 22:24
Study code examples from W3 Schools. Great sample code there. I was able to figure it out that way. This lesson really drives home the subtle difference between Variables and Objects. The code does some of the work for you already, starting with the objects and their syntax, followed by a variable. I would have realized it sooner if I would have "proofed/checked" my code sooner.
Willard RoseberryLevel 11 , Brigham City
16 November 2019, 05:10
I cant figure out the variable that it wants with the cat object. Any hints to help out?
Thaddeus B Cornish Jr.Level 3 , Nassau
15 November 2019, 21:44
LOL BROOOO, I got it right, and like this is hilarious . All I can and wlll say guys is read the lesson and focus attentively on what objects is and what it consists of.
JamieLevel 5 , Austin
2 October 2019, 17:05
I couldn't come up with a worse instruction description for this. Makes absolutely no sense.
RomanLevel 41
3 October 2019, 06:22
Any suggestions?
JamieLevel 5 , Austin
3 October 2019, 19:21
The "and" implies 10 variables with 8 separate objects IMO. I would suggest rewording to 8 and 2 or at the very least replace "and" with "with" or "including" or something similar. That still makes it a bit more of a trick question but the way it's worded implies a total of 18 things that need to be outputted.
Glenn MeyerLevel 8 , Cleveland
24 October 2019, 17:42
"Create 10 Cat variables, 8 of which are initialized Cat objects." Something like that would be clearer. As written, 18 things are implied to be done.
ErenLevel 41 , Shiganshina
29 October 2019, 06:54
Actually, 18 things should be done. For example:
// Variable has been created. We can assign some value to it later.
Cat cat8;

// Object has been created. Since there are no links to it,
// we can’t do anything with it and it will be destroyed
// by the garbage collector, but nonetheless.
new Cat();

// two (!!!) things have been created, variable and object
Cat cat7 = new Cat();
Glenn MeyerLevel 8 , Cleveland
29 October 2019, 22:20
Interesting! Last week when I wrote this, I would not have understand the nuance or difference. But between your explanation and what I've learned in the past week, this makes sense.
Willard RoseberryLevel 11 , Brigham City
16 November 2019, 05:20
Thanks so much for the // Variable has been created. We can assign some value to it later. Cat cat8; It really helped me understand whats going on with a Variable when it is assigned to an object instead of a primitive value like int or float. So an object name can be created and it becomes a type of container that can be assigned a value. ClassName valueAssignedto; just like int num1;
ErenLevel 41 , Shiganshina
16 November 2019, 08:10
Right. Glad to be of service!
BelindaLevel 4 , Portland
11 May, 22:35
Thanks. Good clarification.
Nitish ojhaLevel 3 , gwalior
28 July 2019, 18:18
/* Comment has been deleted */
RomanLevel 41
29 July 2019, 05:35
Posting the solution in the comments is prohibited.
Sai SrikarLevel 2 , Hyderabad
12 July 2019, 16:06
I have completed it but I have little bit confusion in the execution of the program. Can anyone explain it briefly? I mean how the objects are being referenced like that.
Stefan CraiaLevel 15 , Bucharest
12 June 2019, 22:07
The problem is ambiguous, it should sound like this: Create 10 Cat variables, 8 Cat objects and 2 Cat variables.