Check out example codes for "what is never closed java". It will help you in understanding the concepts better.

Code Example 1

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();
    }
}

Learn ReactJs, React Native from akashmittal.com