关于API的问题
我初学JAVA 想问一个关于API的问题。
这是java.sql.ResultSet的源代码的一部分:
package java.sql;
import java.math.BigDecimal;
public interface ResultSet extends Wrapper {
boolean next() throws SQLException;
void close() throws SQLException;
boolean wasNull() throws SQLException;
String getString(int columnIndex) throws SQLException;
.....
....
}
它是个接口为什么它还可以这么用:
ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
不是说接口不能NEW吗?