illegal start of an expression!!

• 06-06-2013, 08:42 PM
gbonecapone
illegal start of an expression!!
i am totally stumped on why im getting these two errors. can someone take a look at it?

double newT;

if (newT > t) && (lf > li) ERROR HERE unexpected type. required class. found value.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
di = (newT - l * dinv - df * ((1 / lf) - dinv)) / ((1 / li) - dinv);
else{

//GOTO 1505
t=ta+ti+tf;
if (newT < t) && (lf > li) { ERROR HERE ";" expected <<<<<<<<<<<<<<<<<<<<<<<<<<<<
df = (newT - l * dinv - di * ((1 / li) - dinv)) / ((1 / lf) - dinv);
tf = df / lf;
// }//THEN GOSUB 1520: GOTO 1505
t=ta+ti+tf;
if (lf < li) {
double templf = lf; lf = li; li = templf;
double tempdf = df; df = di; di = tempdf;
double tempTF = tf; tf = ti; ti = tempTF;
if (newT > t){
di = (newT - l * dinv - df * ((1 / lf) - dinv)) / ((1 / li) - dinv);
ti = di / li;
}
} else{ df = (newT - l * dinv - di * ((1 / li) - dinv)) / ((1 / lf) - dinv);
tf = df / lf;}
double templf = lf; lf = li; li = templf;
double tempdf = df; df = di; di = tempdf;
double tempTF = tf; tf = ti; ti = tempTF;
}}
df = (newT - l * dinv - di * ((1 / li) - dinv)) / ((1 / lf) - dinv);
tf = df / lf;
t=ta+ti+tf;
• 06-06-2013, 08:51 PM
JosAH
Re: illegal start of an expression!!
Quote:

Originally Posted by gbonecapone
if (newT > t) && (lf > li) ERROR HERE unexpected type. required class. found value.<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

The syntax is if ( ... )

Check your parentheses, you wrote if ( ... ) && ( ... )

You probably wanted to write if (newT > t && lf > li)

b.t.w. those are terrible variable names ...

kind regards,

Jos
• 06-06-2013, 08:51 PM
sehudson
Re: illegal start of an expression!!
```public class Example { //code here }```