Java考试题之五】的更多相关文章

QUESTION 102 Given: 23. Object [] myObjects = { 24. new Integer(12), 25. new String("foo"), 26. new Integer(5), 27. new Boolean(true) 28. }; 29. Arrays.sort(myObjects); 30. for(int i=0;i<myObjects.length; i++) { 31. System.out.print(myObjects…
今天开始实战Java虚拟机之五“开启JIT编译” 总计有5个系列 实战Java虚拟机之一“堆溢出处理” 实战Java虚拟机之二“虚拟机的工作模式” 实战Java虚拟机之三“G1的新生代GC” 实战Java虚拟机之四“禁用System.gc()” 实战Java虚拟机之五“开启JIT编译” Java虚拟机有3种执行方式,分别是解释执行.混合模式和编译执行,默认情况下处于混合模式中.使用命令行java –version可以查看虚拟机的执行模式: C:\Users\Administrator>java…
World Wind Java 使用IconLayer图层类表现点和多点数据,使用RenderableLayer图层表现线和面数据,一个图层只能对应一组shape文件.World Wind Java首先使用ShapefileLoader类完成对shape文件的读取和加载,再通过createLayerFromSource方法创建RenderableLayer,最后将创建的Layer加在layers上.源码如下: /** * * 方法名称: AddShapeData : * 方法描述: 添加本地sh…
原型模式虽然是创建型的模式,但是与工程模式没有关系,从名字即可看出,该模式的思想就是将一个对象作为原型,对其进行复制.克隆,产生一个和原对象类似的新对象.本小结会通过对象的复制,进行讲解.在Java中,复制对象是通过clone()实现的,先创建一个原型类: [java] view plaincopy public class Prototype implements Cloneable { public Object clone() throws CloneNotSupportedExcepti…
QUESTION 230 Given: 10. class One { 11. public One foo() { return this; } 12. } 13. class Two extends One { 14. public One foo() { return this; } 15. } 16. class Three extends Two { 17. // insert method here 18. } Whichtwo methods, inserted individua…
QUESTION 177 Given: 1.     class TestException extends Exception { } 2.     class A { 3.     public String sayHello(String name) throws TestException { 4.     if(name == null) throw new TestException(); 5.     return "Hello " + name; 6.     } 7.…
QUESTION 139 Giventhe following directory structure: bigProject |--source | |--Utils.java ||--classes |-- And the following command line invocation: javac -d classessource/Utils.java Assume the current directory is bigProject, what is theresult? A.  …
QUESTION 134 Given:11. class Snoochy {12. Boochy booch;13. public Snoochy() { booch = new Boochy(this); }14. }15.16. class Boochy {17. Snoochy snooch;18. public Boochy(Snoochy s) { snooch = s; }19. } And the statements:21. public static void main(Str…
QUESTION 73 Given: 10: public class Hello { 11: String title; 12: int value; 13: public Hello() { 14: title += " World"; 15: } 16: public Hello(int value) { 17: this.value = value; 18: title = "Hello"; 19: Hello(); 20: } 21: } and: 30:…
QUESTION 46Given:11. public class Test {12. public static void main(String [] args) {13. int x = 5;14. boolean b1 = true;15. boolean b2 = false;16.17. if ((x == 4) && !b2 )18. System.out.print("1 ");19. System.out.print("2 ");2…