What I'm doing bad?


#1

I dont know what to do with this exercise. I don't understand the constructor and others. Please can someone tell me what I'm doing wrong?

Exercise:

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

	}
}

Objective:

Add a class constructor called Dog to the class.

Note: If you're getting an error in the console about a main method, include the following code within the Dog class (it will be explained later in this lesson):

public static void main(String[] args) {

}

Console says:

Add a class constructor called Dog to the class.

Note: If you're getting an error in the console about a main method, include the following code within the Dog class (it will be explained later in this lesson):

public static void main(String[] args) {

}


#2

That is not valid Java.

Read the exercise instructions and/or previous exercises to see the syntax for a constructor. If you still can't figure it out after exerting a reasonable amount of effort, go ahead and tell me.


#3

Hey @theyeahoscar . Ok you got this wrong. But no need to worry! :smile:

Let me show you step by step.

Create a class called Dog:

class Dog {
}

Create the constructor of Dog Class:

public Dog() {
}

Then finally get your main inside:

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

Hope this helped!


#4

pls help me i still cant figure it out


#5

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