java常用输出技巧,debug

java常用输出技巧,debug

package control;

import javax.swing.JFrame;

public class DebugTest {

    public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println();
System.out.println(true);
System.out.println(new JFrame(){
@Override
public String toString() {
// TODO Auto-generated method stub
//return super.toString();
return "This is a jframe.";
}
}); System.err.println("There is an error.");
}
}

java常用输出技巧,debug

package control;

import javax.swing.JFrame;

public class DebugTest {

    public static void main(String[] args) {
int [] ints = new int[];
try {
for (int i = ; i < ; i++) {
ints[i] = i+;
System.out.println(ints[i]);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.err.println("数组越界!");
}
}
}
上一篇:php的opcode缓存


下一篇:BZOJ1452 [JSOI2009]Count [2017年4月计划 树状数组02]