The class constructor for the Dog class


#1



Replace this line with your code.


#2

class Dog {
//The class constructor for the Dog class
public Dog() {

 }

}

public static void main(String[] args){

}


#3

what iam doing wrong here ??


#4

What is the link of the exercice?


#5

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


#6

Unfortunately i can't see the exercice yet. What is the instruction?


#7

i want to creat a constructor for the class but some thing going wrong and idonot know what it is ??


#8

Do you get error if you remove the public static void main ...?


#9


#10

oops... My fault.. Replace the main inside of the class. Like

class Dog{
    public Dog(){}
    public static void main(String[] args){}
}

#11

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)


#12

ok i got it
the sentence of //The class constructor for the Car class was the mistake
i should not write it


#14

thanks for your help :relieved:


#15

You're welcome. :+1:


#16

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.