例外のキャッチを学習するだけです。これにより、「高さを変数に解決できません」が生成されます。私は決定的な何かを見逃していると思います。
import java.util.*;
public class Step4_lab01
{
public static void main(String[] args)
{
Scanner userIn = new Scanner(System.in);
System.out.print("Input height: ");
try {
int height = userIn.nextInt();
}
catch(InputMismatchException e)
{
System.out.println("ERORRORrr");
}
System.out.print("Input width: ");
int width = userIn.nextInt();
Rectangle rektangel1 = new Rectangle(height,width);
rektangel1.computeArea();
}
}