0

hi

im constructing a rectangle in main method, i wrote:

rectangle t = new rectangle();

but i get message on compilation:

cannot find symbol
symbol:constructor retcangle()
location:class rectanlge()
                   rectangle t = new rectangle();
                                      ^

what is wrong?

2
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by hooknc
0

There are a few things that could be the problem.

My first guess is that the class is actually a Rectangle instead of a rectangle.

Second, the Rectangle class might not have a zero parameter constructor. It might only have a constructor of Rectangle(int length, int width).

Third, from your post, unless you didn't cut and paste, there is a typo with the constructor found by this error: symbol:constructor retcangle().

Regards,

Nate

0

so if i am missing the parameters from the class how do i write it in the construting object. and how do i knw how many parameters i have

0

If the Rectangle class your's? If so, can you post the class? If the class isn't your's there should be generated java doc for that class that explains how to use the class.

Regards,

Nate

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.