public class Holt extends Thread{ private String sThreadName; public static void main(String argv[]){ Holt h = new Holt(); h.go(); } Holt(){} Holt(String s){ sThreadName = s; } public String getThreadName(){ return sThreadName; } public void go(){ Holt first = new Holt("first"); first.start(); Holt second = new Holt("second"); second.start(); } public void start(){ for(int i = 0; i < 2; i ++){ System.out.println(getThreadName() +i); try{ Thread.sleep(100); } catch(InterruptedException e){ System.out.println(e.getMessage()); } } } } 当编译运行上面的Java代码时,将会出现()。
class A { A() { } } class B extends A { } Which two statements are true?()
On a hydrocarbon flammability chart the line which extends from 0% to 21.8% oxygen,lying tangent to the flammability range,is called the().
class ThreadBoth extends Thread implements Runnable { public void run(){ System.out.print("hi "); } public static void main(String [] args){ Thread t1 = new ThreadBoth(); Thread t2 = new Thread(t1); t1.run(); t2.run(); } } 结果为:()
Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()
public class Holt extends Thread{ private String sThreadName; public static void main(String argv[]){ Holt h = new Holt(); h.go(); } Holt(){} Holt(String s){ sThreadName = s; } public String getThreadName(){ return sThreadName; } public void go(){ Holt first = new Holt("first"); first.start(); Holt second = new Holt("second"); second.start(); } public void start(){ for(int i = 0; i < 2; i ++){ System.out.println(getThreadName() +i); try{ Thread.sleep(100); } catch(InterruptedException e){ System.out.println(e.getMessage()); } } } } 当编译运行上面的Java代码时,将会出现()。
Public class Holt extends Thread{ Private String sThreadName; Public static void main(String argv[]) { Holt h=new Holt(); h.go(); Holt(){}; Holt(String s){ sThreadName=s; Public String getThreadName() { return sThreadName;} } Public void go(){ Hot first=new Hot("first"); first.start(); Hot second=new Hot("second"); second.start(); } Public void start() { For(int i=0;i<2;i++) { System.out.print(getThreadName()+i); Try{ Thread.sleep(100); }catch(Exception e){ System.out.print(e.getMessage()) ; } } } } 当编译运行上面代码时,将会出现()
11. class Cup { } 12. class PoisonCup extends Cup { } 21. public void takeCup(Cup c) { 22. if(c instanceof PoisonCup) { 23. System.out.println(”Inconceivable!”); 24. } else if(c instanceof Cup) { 25. System.out.println(”Dizzying intellect!”); 26. } else { 27. System.exit(0); 28. } 29. } And the execution of the statements: Cup cup = new PoisonCup(); takeCup(cup); What is the output?()
Given: 6. 7.<%="processing" %> 8. and a custom tag handler for foo which extends TagSupport. Which two are true about thetag handler referenced by foo?()
class Parser extends Utils { public static void main(String [] args) { System.out.print(new Parser().getInt("42")); } int getInt(String arg) { return Integer.parseInt(arg); } } class Utils { int getInt(String arg) throws Exception { return 42; } } 结果为:()