我真的不知道这是否可能.但是我想要检查一个int值是null不是要调用不同的方法.
有什么办法吗?
实际上,变量来自具有null值的浏览器.我无法将int声明更改为Integer.因为它有它自己的后果.
有什么建议?
Jtable不显示列标题.我正在使用向量来填充JTable,但它似乎仍然不起作用.这是代码:
public class InsertFileToJtable extends AbstractTableModel{
Vector data;
Vector columns;
private String[] colNames = {"col1","col2","col3","col4","col5","col6","col7","col8"};
public InsertFileToJtable() {
String line;
data = new Vector();
columns = new Vector();
try {
FileInputStream fis = new FileInputStream("ProcessList.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
StringTokenizer st1 = new StringTokenizer(br.readLine(), " ");
while (st1.hasMoreTokens())
columns.addElement(st1.nextToken());
while ((line = br.readLine()) != null) {
StringTokenizer st2 = new StringTokenizer(line, " ");
while (st2.hasMoreTokens())
data.addElement(st2.nextToken());
}
br.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public int …Run Code Online (Sandbox Code Playgroud) 可能重复:
这和java中的超级
我是发展新手.我仍然无法理解的是这个和超级关键字之间的区别.如果有任何答案,我们将非常感激.谢谢.