Need help with the Calculator project

In step 2 i need to :
“Inside of the class, create a Calculator constructor. You can leave the contents of the constructor empty.”
and i didnt get it.

The same problem in step 3 :

“Next, create a public method that returns an int and call it add.”

Anyone can show me how it supposed to look like ?

a constructor is a special method to set initial values for field variables.
it must have the same name of the class. if your class name is Calulator your method will be:

Calculator () {
// here you can init your class
// but it can be also empty…


Maybe the Manual helps…
google search
== the Java Book ==
public int method

1 Like