public class A{ public static void closePreparedStatement(){ } } 用public修饰 之后其他内里面直接就可以使用 A.closePreparedStatement();