-2

infinte whileループの実行中にJavaでスレッドを実行しているのですが、2つのifステートメントがfalseを返すことはありません。

        } catch (NumberFormatException ne) {
            ne.printStackTrace();
        }

    }
}
4

1 に答える 1

2

You need to use equals when comparing strings:

if(!jTextField5.getText().equals(s2))

and

if (!s9.equals(jTextField6.getText()))

The regular equality/inequality operators compare objects in memory, not string contents.

于 2012-10-01T10:13:41.500 に答える