资源泄漏:“in”永远不会关闭
2022-08-31 09:47:17
为什么 Eclipse 在下面的代码中给我加热“资源泄漏:'in'永远不会关闭”?
public void readShapeData() {
Scanner in = new Scanner(System.in);
System.out.println("Enter the width of the Rectangle: ");
width = in.nextDouble();
System.out.println("Enter the height of the Rectangle: ");
height = in.nextDouble();