私は現在、テキストブックからプロジェクトに取り組んでおり、while ループにあいまいな問題がありました。テキストブックのコードは次のとおりです。
while(getImage().getWidth(applet) <= 0);
double x = applet.getSize().width/2 - width()/2;
double y = applet.getSize().height/2 - height()/2;
at = AffineTransform.getTranslateInstance(x, y);
最後にセミコロンを付けて宣言された while ループを見たことがないので、コードを標準であると解釈しました。
while(getImage().getWidth(applet) <= 0) {
double x = applet.getSize().width/2 - width()/2;
double y = applet.getSize().height/2 - height()/2;
at = AffineTransform.getTranslateInstance(x, y);
}
誰かが2つの違いを説明できますか? コードを最初のように変更したところ、プログラムは問題なく動作しましたが、違いがわかりません。