3/13 Dog constructor what am i doing wr?ong


#1

Dont know what im doing wrong :frowning: i already resetted it


#2

Please post a link to this exercise. Thank you.


#3

https://www.codecademy.com/en/courses/learn-java/lessons/object-oriented-programming/exercises/classes-constructors?action=resume


#4

I don't know if this is going to help, but I notice the top line is missing extends Animal, as in,

class Dog extends Animal {

#5

Hi, for this exercise you need to add parameters to the dog class constructor. It's similar to the example given -
public Car(int year)


#6

Might there be a bug with this lesson? I tried using parameters as suggested and it still wasn't working. After several attempts it asked if I wanted the code. I pressed 'get code' and it gave me:

public Dog() {

}

That seemed to solve the problem, but it didn't work when I typed the exact same code out on my first attempt. It only worked when I pressed 'get code'.


#7

hi, i`m stuck in the same excercise. I'm tottaly noob in programming and i could say that some excercises are confusing such as this one. Its seems like the one who created it supposes that the 'student' will know some things that should be obvious. For exemple, since i begun the course i do not know how to start programming yet (i mean, the chain of commands that may be goes in the begining of the 'wordpad', like i've seen in other places like 'making' webs that use commands like "body" and "main". Sorry if i'm not so clear but i think you can 'catch' the idea).


#8

try making sure there's no space between Dog and (), and if that doesn't work, reset your code and do the same thing. that's what worked for me!


#9

thnx... it helped! :clap:


#10

4/13-Create int age-not sure where i am going wrong.

class Dog{
  
int Age;
public static void main(String[] args) {
  

  
public Dog() {

   
	}

}

#11

should be, int age, according to the instructions.


#12

I had the same problem until I added the correct indentation


#13

Yeah there is a bug with this lesson. I typed exactly as instructed and it still wouldn't work. So then I hit GET CODE. and it fetched the same code.