954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

cant construct rectangle

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?

sam1
Posting Whiz
300 posts since Nov 2004
Reputation Points: 10
Solved Threads: 1
 

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

hooknc
Posting Whiz in Training
219 posts since Aug 2005
Reputation Points: 11
Solved Threads: 8
 

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

sam1
Posting Whiz
300 posts since Nov 2004
Reputation Points: 10
Solved Threads: 1
 

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

hooknc
Posting Whiz in Training
219 posts since Aug 2005
Reputation Points: 11
Solved Threads: 8
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You