<variable>(Java.lang.string) in <classname> cannot be applies to ()
Ok, now I realise this is only my second post and I'm sorry that its going to be a biggie, but this has me completely stumped.
To start with, this is for a university course, so I don't want you guys to give me the answer (IE code) but I would love some idea of where it is I am going wrong here. I'll post the code.
is the constructor I am attempting to create.
public class Triangle
/* instance variables */
int size; // the size of the triangle; an integer between 2 and 10 inclusive
String orientation; // either "up" or "down"
* Constructor for objects of class Triangle.
// M255 TMA 02 Q1 (i)
// size = 5;
// orientation = "down";
this.inputSize() = startSize;
this.inputOrientation() = startOrientation();
public void inputSize(String uSize)
uSize = OUDialog.request("Please enter an integer between 2 and 10 inclusive.");
size = Integer.parseInt(uSize);
OUDialog.alert(uSize + " is outside the parameters of the request.");
are the two methods I am trying to call when the class is initialised.
public void inputOrientation(String uOrientation)
uOrientation = OUDialog.request("Please enter the orientation of your triangle, 'up' or 'down'.");
orientation = uOrientation;
OUDialog.alert(uOrientation + " is neither the word 'up' or 'down'.");
The idea is (in the modified BlueJ workspace) when
is executed, a dialog box comes up asking for the size and orientation of the desired triangle. If neither of them fall within the requested parameters, the user is alerted and told to try again.
t = new Triangle();
I'm happy with the two loops inputSize() and inputOrientation() but when I try to compile with the new constructor (posted waaay above) I get an error which says
I don't know what I've done wrong here, can anyone please pont me in the right direction?
inputSize(java.lang.String) in Triangle cannot be applied to ()