import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class AutoCloseblePractice {
public static void main(String[] args) {
try ( A a = new A() )
{
a.doSome();
} catch (Exception e) {
System.out.println("213");
} finally{
}
}
}
class A implements AutoCloseable {
public void doSome() {
System.out.println("dosome");
}
public void close() throws Exception {
// TODO Auto-generated method stub
System.out.println("close");
}
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class AutoCloseblePractice {
public static void main(String[] args) {
try ( A a = new A() )
{
a.doSome();
} catch (Exception e) {
System.out.println("213");
} finally{
}
}
}
class A implements AutoCloseable {
public void doSome() {
System.out.println("dosome");
}
public void close() throws Exception {
// TODO Auto-generated method stub
System.out.println("close");
}
}