if.else example 如果半径大于0,则计算并显示圆的面积,否则提示无效输入。 if (radius > 0) area radius*radius*PI System. out. println ("The area for the +circle of radius n radius n is area)i else System. out. println("Negative input")iif...else Example 如果半径大于0,则计算并显示圆的面积,否则提示无效输入。 if (radius >= 0) { area = radius*radius*PI; System.out.println("The area for the “ + “circle of radius " + radius + " is " + area); } else { System.out.println("Negative input"); }