473,408 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How come Driver won't recognize Constructor and parameter

I really cannot find anything wrong with this, I have checked it at least 5 times, and there is nothing I see that can make the driver not recognize the constructor. Ok, so here is my Rectangle class

import gpdraw.DrawingTool;
import gpdraw.SketchPad;

public class Rectangle {

private double base;
private double height;
private DrawingTool myPencil;
private SketchPad myPad;

public Rectangle(double w, double h, SketchPad pad){
base = w;
height = h;
myPad = pad;
myPencil = new DrawingTool(pad);
}

public void drawRect(){
myPencil.drawRect(base, height);
}

public double getPerimeter(){
return 2*base + 2*height;
}

public double getArea(){
return base*height;
}
}



This compiles fine, the computer doesn't complain about any errors. This driver seems to be causing problems, even though I don't know what is wrong.

Here is my driver

import gpdraw.DrawingTool;
import gpdraw.SketchPad;

public class Driver{

public static void main(String[] args){

SketchPad paddy = new SketchPad(500, 500);
Rectangle rect1 = new Rectangle(100, 300, paddy);
Rectangle rect2 = new Rectangle(300, 100, paddy);
Rectangle rect3 = new Rectangle(300, 300, paddy);

}
}



I pass in SketchPad object paddy to the constructor, but here is the error message I get when I compile the driver

cannot find symbol constructor Rectangle(int,int,gpdraw.SketchPad) line 9
cannot find symbol constructor Rectangle(int,int,gpdraw.SketchPad) line 10
cannot find symbol constructor Rectangle(int,int,gpdraw.SketchPad) line 11

This is really bugging me, is there something wrong with my entire computer?
Oct 3 '09 #1
1 2240
Never mind, I admit I make the dumbest errors in the world. I put the two classes in different folders... ):p
Oct 3 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
0
by: Bing | last post by:
Hi, I am configuring the same DB2 v8.1 JDBC universal driver (db2jcc.jar and db2jcc_license_cisuz.jar) from DB2 SP5 fix pack under WSAD 5.1.x environment and WebSphere application Server 5.0.2...
3
by: Andrew Johnson | last post by:
Hi, I am trying to make a UBD DB2 7.2 connection using the Java COM.ibm.db2.jdbc.app.DB2Driver via Tomcat 3.2.1 on Solaris (and also on an AIX system with 3.3.1). I am attempting this either...
3
by: DFS | last post by:
I've been working around this for years (I believe), so I figured someone here might know: Why won't a crosstab query accept a value from a form reference? TRANSFORM...
26
by: Paul | last post by:
public class A { public A () { // here I would like to call the second version of _ctor, how to accomplish this ? } public A (int a, int b, int c) {
4
by: indigator | last post by:
I have an ASP.Net web service class, DataLayer.asmx.cs. I have two constructors for the DataLayer class. One is the default parameter-less one and the second one accepts a string argument. When I...
10
by: B Williams | last post by:
I have been working with this code for a better part of the day and I can't figure out where I am making a mistake. I can only imagine it is when I declare multiple paramaters on the constructor...
13
by: sam_cit | last post by:
Hi Everyone, I have the following unit to explain the problem that i have, class sample { public : sample() { printf("in sample...\n"); }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.