Max, Bella, and Jack

  • 2
  • Locked
If you open this task, you will find an existing Dog class. We need to create several dogs. We've already thought up their stories: we know how they look, what names they respond to, etc. But in this task, we are interested in the following: create three Dog objects, and then name them "Max", "Bella", and "Jack".
You can't complete this task, because you're not signed in.
Comments (9)
  • Popular
  • New
  • Old
You must be signed in
KIN SOCHEATLevel 8 , Phnom Penh
28 April, 02:35
Lesson list Creating objects
KIN SOCHEATLevel 8 , Phnom Penh
28 April, 02:34
/* The comment was deleted */
RomanLevel 41
2 May, 06:41
Posting the solution in the comments is prohibited.
Divya DammalapatiLevel 2 , Hyderabad
1 December 2018, 11:44
Can someone explain about class,object,variable and reference clearly??
parth shahLevel 3 , Mumbai
15 November 2018, 14:29
My Code :: public class Solution { public static void main(String[] args) { Dog Max = new Dog(); Dog Bella = new Dog(); Dog Jack = new Dog(); //write your code here } public static class Dog { public String name; } } Question is :: Why condition ''Each Dog object must be assigned a name'' is not getting fulfilled here ? I think i m missing something.
RomanLevel 41
16 November 2018, 08:00
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
Ajibola OluwatosinLevel 3 , Lagos
28 February, 09:40
The instance variable name is in the class Dog. You are meant to assign this variable the names of the dog. Dog object = new Dog(); object.name = "name_of_dog";
vikas guptaLevel 3 , Bareilly
14 October 2018, 06:26
/* The comment was deleted */
RomanLevel 41
16 October 2018, 05:51
Posting the solution in the comments is prohibited.