|
-
Dodgy class
I made this class:
class InOb {
int i, j;
boolean pass = true;
public InOb(int si, int sj) {
i = si;
j = sj;
}
public void drs(Graphics g, int xplus, int yplus, Container cont) {
tileIcon.paintIcon(cont, g, xplus, yplus);
g.drawLine(xplus, yplus, xplus + 50, yplus);
g.drawLine(xplus, yplus, xplus, yplus + 50);
g.drawLine(xplus + 50, yplus + 50, xplus + 50, yplus);
g.drawLine(xplus + 50, yplus + 50, xplus, yplus + 50);
g.drawString("its" + i + " " + j, xplus + 5, yplus + 30);
}
}
works fine.
But:
class Bush extends InOb {
public void drs(Graphics g, int xplus, int yplus) {
g.drawLine(xplus, yplus, xplus + 50, yplus);
g.drawLine(xplus, yplus, xplus, yplus + 50);
g.drawLine(xplus + 50, yplus + 50, xplus + 50, yplus);
g.drawLine(xplus + 50, yplus + 50, xplus, yplus + 50);
g.drawString("its" + i + " " + j, xplus + 5, yplus + 30);
}
}
doesn't work - it says:
Move/Move.java [39:1] cannot resolve symbol
symbol : constructor Bush (int,int)
location: class Move.Bush
bits [0] [i] = new Bush(0, i);
^
Move/Move.java [143:1] InOb(int,int) in Move.InOb cannot be applied to ()
class Bush extends InOb {
^
2 errors
Errors compiling Move.
please help!
JJS
Penguins Rule!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks