网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列方法中哪一个不能用于获取异常信息()?

A、toStrinG()

B、getMessage()

C、drawline()

D、printStackTrace()


参考答案

更多 “ 下列方法中哪一个不能用于获取异常信息()?A、toStrinG()B、getMessage()C、drawline()D、printStackTrace() ” 相关考题
考题 阅读下列Java程序和程序说明,将应填入(n)处的字句写在对应栏内。【说明】下面的程序先构造Point类,再顺序构造Ball类。由于在类Ball中不能直接存取类Point中的xCoordinate及yCoordinate属性值,Ball中的toString方法调用Point类中的toString方法输出中心点的值。在MovingBall类的toString方法中,super.toString调用父类Ball的toString方法输出类Ball中声明的属性值。public class Point{private double xCoordinate;private double yCoordinate;public Point 0 }public Point(ouble x, double y){xCoordinate = x;yCoordinate = y;}public String toString(){return "( + Double.toString(Coordinate)+ ","+ Double.toString(Coordinate) + ");}//other methods}public class Ball{(1); //中心点private double radius; //半径private String colour; ///颜色public Ball() { }public Ball(double xValue, double yValue, double r)// 具有中心点及半径的构造方法{center=(2);//调用类Point 中的构造方法radius = r;}public Ball(double xValue, double yValue, double r, String c)// 具有中心点、半径及颜色的构造方法{(3);//调用3个参数的构造方法colour = c;}public String toString(){return "A ball with center" + center, toString() + ", radius"+ Double.toString(radius) + ", colour" + colour;}//other methods}public class MovingBall. (4){private double speed;public MovingBall() { }public MovingBall(double xValue, double yValue, double r, String e, double s){(5);// 调用父类Ball中具有4个参数的构造方法speed = s;}public String toString( ){ return super, toString( ) + ", speed "+ Double.toString(speed); }//other methods}public class Tester{public static void main(String args[]){MovingBall mb = new MovingBall(10,20,40,"green",25);System.out.println(mb);}}

考题 在下面程序的下画线处,填入适当的语句使程序能正确执行并输出异常栈信息。public class ThrowableException {public static void main(String args[]) {try {throw new Throwable("这里是本人定义的异常");} catch(Throwable e) {System.out.println("Caught Throwable");System.out.println("e.getMessage():"+e.getMessage());System.out.println("e.toString():"+e.toString());System.out.println("e.printStackTrace():");______}}}

考题 ( 11 )在下列程序的下划线处,填入适当语句使程序能正确执行并输出异常栈信息。public class ThrowableException{public static void main(String args[]){try{throw new Throwable(" 这里是本人定义的异常 ");}catch(Throwable e){System.out.println("Caught Throwable");System.out.println("e.getMessage(): "+e.getMessage());System.out.println("e.toString(): "+e.toString());System.out.println("e.printStackTrace(): ");【 11 】 ;}}}

考题 如果要在 Applet 中显示特定的文字、图形等信息,可以在用户定义的 Applet 类中重写的方法是A)paint()B)update()C)drawString()D)drawLine()

考题 下列哪一项不属于Applet中的显示方法?() A、update()B、repaint()C、drawLine()D、paint()

考题 下列关于Thread类中方法的叙述正确的是( )。A.方法activeCount()的功能是获取当前活动的线程数B.方法enumerate()的功能是拷贝当前活动线程信息C.方法getName()获取线程的名称,而方法getThreadGroup()可以获取当前线程所属线程组的名称D.方法toString()的功能是转化输入的数据类型,以字符串形式输出

考题 如果要在Applet中显示特定的文字、图形等信息,可以在用户定义的Applet类中重写的方法是A.paint()B.update()C.drawstring()D.drawLine()

考题 下列关于System类中getProperties()方法的描述中,正确的是?() A、getProperties()方法用于获取当前的操作系统的属性B、getProperties()方法用于获取当前JVM的属性C、getProperties()方法用于获取指定键指示的操作系统属性D、getProperties()方法用于获取指定的JVM的属性

考题 2、在视频中,自定义异常类FailException采用()方法返回异常信息。A.FailException()B.setMessage()C.toString()D.未定义方法