下面代码片段错误的是?

分类: 单选题 发布时间: 2024-01-20 20:41 浏览量: 1

下面代码片段错误的是?

A.try(Doctor d = new Doctor())

B.try (FileInputStream is = new FileInputStream("A、txt"))

C.try(Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "111"))

D.try( Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "111"); Statement stmt = connection.createStatement(); )

正确答案是A