# My code have a simple error but i dont know how to solve it !!!

• March 16th, 2011, 11:00 AM
Blackhawk1993
My code have a simple error but i dont know how to solve it !!!
ImageShack&#174; - Online Photo and Video Hosting

Imageshack - erronobluej.jpg

==========================//====================

Code Java:

```public class Bhaskara { int a; int b; int c; int d; double x; double x2; public Bhaskara () { a=1; b=1; c=1; d=1; }     public void seta ( int a ); { valor_a=a;   }   public void setx ( double x ); { valor_x=x; }   public void setx2 ( double x2 ); { valor_x2=x2; }     public void setb ( int b ); { valor_b=b;   }   public void setc ( int c ); { valor_c=c;   }   int d = b*b- (4*a*c);   void apply () { if (d = 0) public double xvalue; x = -b + Math.pow (d;1/2)/2*a; return x;       else (d < 0) public staticm void main ( string args [] ) { System.out.println ("There'so possible answer"); }   else ( d > 0 ) public double xvalue; x = -b + Math.pow (d;1/2)/2*a; return x; public double x2value; x2 = -b - Math.pow (d;1/2)/2*a; return x2; }```
• March 16th, 2011, 05:45 PM
JavaPF
Re: My code have a simple error but i dont know how to solve it !!!
Those images are too small to see the errors.

What seems to be the problem exactly? Please give us as much detail as possible.

Looking at the code, I can see lot's of errors straight away. I suggest going back to basics - The Java™ Tutorials

My first hint would be to look at the methods.
• March 17th, 2011, 03:47 AM
Blackhawk1993
Re: My code have a simple error but i dont know how to solve it !!!
Code Java:

```void apply () { if (d = 0) public double xvalue; x = -b + Math.pow (d;1/2)/2*a; return x;```
The error says : " illegal start of expression " in public double x value
• March 17th, 2011, 05:03 AM
JavaPF
Re: My code have a simple error but i dont know how to solve it !!!
Like I said, there are lots of errors in your code.

• Your methods are wrong. Delete ;
• d is a duplicate variable.
• valor_a, valor_b etc are undefined.

Plus x = -b + Math.pow (d;1/2)/2*a; is completely wrong.
• March 17th, 2011, 11:15 AM
Blackhawk1993
Re: My code have a simple error but i dont know how to solve it !!!
Im using BlueJ.... i think its kinda different
• March 17th, 2011, 11:28 AM
Java Neil
Re: My code have a simple error but i dont know how to solve it !!!
Different from what? The syntax is the same, right?
• March 17th, 2011, 01:12 PM
Blackhawk1993
Re: My code have a simple error but i dont know how to solve it !!!
Quote:

Originally Posted by Java Neil
Different from what? The syntax is the same, right?

im not sure, it just shoed that error and that i should put ; at the end of each command