0
Whats that, error «identifier» expected??
can't solve the error I'm new to java so plz do the needfull.
8 Respostas
+ 2
identifier is basically a name.
int x;
x is the identifier, and once I wrote int the compiler was expecting one, As the identifier comes after the variable type.
Similar thing with methods, before the parameters an identifier, or name of the method is expected.
void methodName (){
}
+ 2
I was just explaining the error, the examples weren't meant to be the same issue your having.
Can You post the code here? Maybe then I can point out the problem directly.
+ 2
That code works for me. Make sure there's no extra code somewhere. Maybe outside the class?
+ 1
Remove the "uctor" part. Not sure what thats supposed to be.
0
actually I was getting the error in a rect program
0
how can I post the code over here
0
class Rect
{
int length,breadth;
Rect(int l,int b)
uctor
{
length=l;
breadth=b;
}
public static void main(String args[])
{
Rect r =new Rect(4,5);
Rect r1= new Rect(6,7);
System.out.println("Area:"+(r.length*r.breadth));
System.out.println("Area:"+(r1.length*r1.breadth));
}
}
0
still getting 6 error