As others have said, you need to call 'close' on IO classes. I'll add that this is an excellent spot to use the try - finally block with no catch, like this:
public void readShapeData() throws IOException {
Scanner in = new Scanner(System.in);
try {
System.out.println("Enter the width of the Rectangle: ");
width = in.nextDouble();
System.out.println("Enter the height of the Rectangle: ");
height = in.nextDouble();
} finally {
in.close();
}
}
This ensures that your Scanner is always closed, guaranteeing proper resource cleanup.
Equivalently, in Java 7 or greater, you can use the "try-with-resources" syntax:
try (Scanner in = new Scanner(System.in)) {
...
}