English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

if (matchedNo.getValue())==1{
Integer.parseInt(jTextFieldWinnings.getText)+1
}

It doesn't like the "==1" bit, I have no idea why.

2007-08-14 03:56:55 · 3 answers · asked by Night_nurse 2 in Computers & Internet Programming & Design

3 answers

"if"-statements' conditions have to be fully enclosed in parentheses. The first thing following the terminating closed-parenthesis should be either a statement or a curly-brace:

if (condition) single_statement;
if (condition) { block_of_code }

In your code, the parenthesis before "==" terminates the parenthesis after "if". As a result, the compiler sees "==" as the first thing after the if condition, which is not a valid statement.

Instead you want:

if (matchedNo.getValue() == 1) {

2007-08-14 04:01:04 · answer #1 · answered by McFate 7 · 4 0

I think == 1 needs to be in the parenthesis. like this

if (matchedNo.getValue() == 1){

2007-08-14 04:01:37 · answer #2 · answered by Dave 2 · 0 0

try this
if (matchedNo.getValue()==1){
Integer.parseInt(jTextFieldWin...
}

2007-08-14 04:02:14 · answer #3 · answered by bat_m_a_n 2 · 0 0

fedest.com, questions and answers