jGrasp-即使代码成功也未显示System.out.println

问题描述 投票:0回答:1

我正在为一个类制作这个Java文件,但是当我使用测试运行器并完成操作时,在控制台中根本不会出现System.out.println()。控制台表示操作已成功完成,但是没有任何反应。

public class ShapeMetrics {
    public static float getAreaOfRectangle(float width, float height) {
        float area = width * height;
        return area;
     }
}
public class TestRunner {
   public static void main(String args[]){

      float w = 6.1F;
      float h = 3.3F;
      float area = ShapeMetrics.getAreaOfRectangle (w, h);
      System.out.println("The area of the rectangle is: " + area);
      System.out.print("test");
   }

}
java system.out jgrasp
1个回答
0
投票

您需要按下控件r而不是控件b,或者换句话说,您需要运行它而不是仅对其进行编译。您也可以使用图标。

© www.soinside.com 2019 - 2024. All rights reserved.