版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
(图片大小可自由调整)2024年计算机考试-Java认证考试近5年真题荟萃附答案第I卷一.参考题库(共100题)1.Which three statements are true?()A、 The default constructor initializes method variables.B、 The default constructor has the same access as its class.C、 The default constructor invoked the no-arg constructor of the superclass.D、 If a class lacks a no-arg constructor, the compiler always creates a default constructor. E、 The compiler creates a default constructor only when there are no other constructors for theclass.2.哪两个是同步的?()A、 java.util.TreeSetB、 java.util.HashtableC、 java.util.VectorD、 java.util.LinkedList3.多态应用于()A、重载B、覆盖C、实现D、组合4.以下哪个类与Swing GUI菜单类无关?() A、JMenuB、JMenuBarC、JMenuItemD、以上皆是5.现有: class Test4 { public static void main (String [] args) { boolean X=true; boolean y=false; short Z=42; if((z++==42) && (y=true))z++; if((x=false) || (++z==45)) z++; System. out.println(¨z=”+z); } } 结果为:() A、 Z=42B、 z=44C、 Z= 45D、 z= 466.已知: 则下面哪段代码是合法的()A、B、C、D、7.什么是多态?面向对象程序设计为什么要引人多态的特性?使用多态有什么优点?8.You need to create a JavaBean object that is used only within the current JSP page. It must NOT beaccessible to any other page including those that this page might import. Which JSP standard action canaccomplish this goal?()A、B、C、D、9.this()和super()只能位于构造函数中的第一句10.Socket通常也称为套接字,用于描述()和()11.Which two are characteristics of the Service Locator pattern?()A、It encapsulates component lookup procedures.B、It increases source code duplication and decreases reuse.C、It improves client performance by caching context and factory objects.D、It degrades network performance due to increased access to distributed lookup services.12.1.publicclassGC{ 2.privateObjecto; 3.privatevoiddoSomethingElse(Objectobj){o=obj;} 4.publicvoiddoSomething(){ 5.Objecto=newObject(); 6.doSomethingElse(o); 7.o=newObject(); 8.doSomethingElse(null); 9.o=null; 10.} 11.} WhenthedoSomethingmethodiscalled,afterwhichlinedoestheObjectcreatedinline5becomeavailableforgarbagecollection?()A、Line5B、Line6C、Line7D、Line8E、Line9F、Line1013. What is the result?()A、 baz has a value of 0.B、 baz has a value of 1.C、 baz has the value of 2.D、 An exception is thrown.E、 The code will not compile.14.涉及类MyClass的方法签名足public void find(MyClass a),那么该方法可接收的实际参数的类型可以是哪些?() A、MyClass类的类型B、MyClass子类的类型C、Object类型D、所有接口15.In which two cases does the compiler supply a default constructor for class A?() A、 class A{}B、 class A { public A(){} }C、 class A { public A(int x){} }D、 class Z {} class A extends Z { void A(){} }16.下面正确的创建Socket的语句是()A、 Socket a = new Soeket(80):B、 Socket b = new Socket("130. 3. 4. 5", 80):C、 ServerSocket c = new Socket(80)D、 ServerSocket d = new Socket ("130. 3. 4, 5", 80)17.Assume the scoped attribute priority does NOT yet exist. Which two create and set new request-scoped attribute priority to the value “medium”?() A、 ${priority = ‘medium’ } B、 ${requestScope[ ‘priority’ ] = ‘medium’ } C、 D、 medium E、 F、 medium G、 18.中间容器,原子组件,菜单栏,工具栏等都直接放在顶级容器下。19.What is the result?() A、Compilation succeeds.B、Exactly one class does NOT compile.C、Exactly two classes do NOT compile.D、Exactly four classes do NOT compile.E、Exactly three classes do NOT compile.20.多线程之间怎样进行同步?21.What is the result?() A、hi hiB、hi worldC、world worldD、Compilation fails.E、An exception is thrown at runtime.22.下面哪些说法是正确的()A、静态方法不能被覆盖B、私有方法不能被重载C、实例变量能够被隐藏D、静态方法能够被重载23.猴子摘桃问题猴子第1天摘下若干桃子,当即吃掉一半,又多吃一个,第二天将剩余的部分吃掉一半还多一个;以此类推,到第10天只剩余1个。问第1天共摘了多少桃子24.现有如下类型: a - java.util.Hashtable b - java.util.List c - java.util.ArrayList d - java.util.SortedSet 和定义: 1 – 使用本接口,允许用户控制集合中每个元素的插入位置。 2 – 使用本集合,确保用户可以按照递增或元素的自然顺序遍历集合。 3 – 本具体类型允许空元素及基于索引的访问。 4 – 本集合是同步的。 哪一组匹配是对的?() A、 1 描述 b; 3 描述 c。B、 2 描述 d; 3 描述 b。C、 3 描述 a; 4 描述 b。D、 4 描述 a; 2 描述 c。25.public class Plant { private String name; public Plant(String name) { = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?() A、 The code will compile without changes.B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.26.Which two create an instance of an array?() A、 int ia = new int [15];B、 float fa = new float [20];C、 char ca = “Some String”;D、 Object oa = new float[20];E、 Int ia = (4, 5, 6) (1, 2, 3)27.public abstract class Shape { int x; int y; public abstract void draw(); public void setAnchor(int x, int y) { this.x = x; this.y = y; } } and a class Circle that extends and fully implements the Shape class. Which is correct?() A、 Shape s = new Shape(); s.setAnchor(10,10); s.draw();B、 Circle c = new Shape(); c.setAnchor(10,10); c.draw();C、 Shape s = new Circle(); s.setAnchor(10,10); s.draw();D、 Shape s = new Circle(); s->setAnchor(10,10); s->draw();E、 Circle c = new Circle(); c.Shape.setAnchor(10,10); c.Shape.draw();28.ArraryList a = new ArrayList(); a.add(“Alpha”); a.add(“Bravo”): a.add(“Charlie”); a.add(“Delta”); Iterator iter = a.iterator(); Which two, added at line 17, print the names in the ArrayList in alphabetical order?()A、 for (int i=0; i29.class java { public static void main(String [] java) { for (int Java = 1; Java 〈 java.length; Java++) System.out.print("java "); } } 和命令行: java java java java java 结果为:() A、javaB、java javaC、java java javaD、编译失败30.Click the ’Select and Place’ button. Place the events in the order they occur. 31.Which thetwo are true about the JSTL core iteration custom tags?()A、 It may iterate over arrays, collections, maps and strings.B、 The body of the tag may contain EL code, but not scripting code.C、 When looping over collections, a loop status object may be used in the tag body.D、 It may iterate over a map, but only the key of the mapping may be used in the tag body.E、 When looping over integers (for example begin1=’1’ end=’10’), a loop status object may not beused in the tag body.32.在Swing中,一下列出的面板的作用中,错误的是()A、 放置并排列组件B、 显示背景图案C、 接收事件D、 显示面板的边框33.package test; class Target { public String name = “hello”; } What can directly access and change the value of the variable name?() A、 any classB、 only the Target classC、 any class in the test packageD、 any class that extends Target34.Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?() A、The rectangle drawn will have a total width of 5 pixels.B、The rectangle drawn will have a total height of 6 pixels.C、The rectangle drawn will have a total width of 10 pixels.D、The rectangle drawn will have a total height of 11 pixels.35.1) class Person { 2) public void printValue(int i, int j) {/*…*/ } 3) public void printValue(int i){/*...*/ } 4) } 5) public class Teacher extends Person { 6) public void printValue() {/*...*/ } 7) public void printValue(int i) {/*...*/} 8) public static void main(String args[]){ 9) Person t = new Teacher(); 10) t.printValue(10); 11) } 12) } Which method will the statement on line 10 call? () A、 on line 2B、 on line 3C、 on line 6D、 on line 736.public class Person { private String name, comment; private int age; public Person(String n, int a, String c) { name = n; age = a; comment = c; } public boolean equals(Object o) { if(! (o instanceof Person)) return false; Person p = (Person)o; return age == p.age && name.equals(); } } What is the appropriate definition of the hashCode method in class Person?() A、 return super.hashCode();B、 return name.hashCode() + age * 7;C、 return name.hashCode() + comment.hashCode() /2;D、 return name.hashCode() + comment.hashCode() / 2 - age * 3;37.class Account { private int balance; public void setBalance(int b) { balance = b; } public int getBalance() { return balance; } public void clearBalance() { balance = 0; } } 哪一个改变可以使 Account 类线程安全?() A、在第2行加 synchronized 修饰符。B、在第3行加 synchronized 修饰符。C、在第3行、第4行和第6行加 synchronized 修饰符。D、在第4行、第6行和第8行加 synchronized 修饰符。38.Which statement is true?() A、 A flow layout can be used to position a component that should resize horizontally when the container is resized.B、 A grid layout can be used to position a component tat should maintain a constant size even when the container is resized.C、 A border layout can be used to position component that should maintain a constant size even when the container is resized.D、 The grid bag layout can be used to give a grid-like layout which differs from the normal grid in that individual rows and columns can have unique sizes.E、 If two components are placed in the same column of a grid bag layout, and one component resizes horizontally, then the other component must resize horizontally.39. What is the value of the variable output at line 24? 40.public static void main(String[] args) { try { args=null; args[0] = “test”; System.out.println(args[0]); } catch (Exception ex) { System.out.println(”Exception”); } catch (NullPointerException npe) { System.out.println(”NullPointerException”); } } What is the result?() A、 testB、 ExceptionC、 Compilation fails.D、 NullPointerException41.In which two web application directories can dependent classes and libraries be located? ()A、 /WEB-INF/lib as a JAR fileB、 /META-INF/lib as a JAR fileC、 /classes as compiled class filesD、 /WEB-INF/lib as compiled class filesE、 /WEB-INF/classes as compiled class filesF、 /META-INF/classes as compiled class files42.以下关于Swing容器叙述,哪项错误?() A、容器是一种特殊的组件,它可用来放置其它组件B、容器是组成GUI所必需的元素C、容器是一种特殊的组件,它可被放置在其它容器中D、容器是一种特殊的组件,它可被放置在任何组件中43.A RequestDispatcher can be obtained from which two objects? ()A、 ServletConfigB、 ServletContextC、 HttpServletRequestD、 HttpServletResponse44.javax.swing.JPopMenu类可用于() A、 创建菜单项B、 创建按钮C、 创建菜单栏D、 创建弹出式菜单45.内部类与外部类的使用有何不同?46.public class Person { private name; public Person(String name) { = name; } public boolean equals(Object o) { if( !o instanceof Person ) return false; Person p = (Person) o; return .equals(); } } Which is true?() A、 Compilation fails because the hashCode method is not overridden.B、 A HashSet could contain multiple Person objects with the same name.C、 All Person objects will have the same hash code because the hashCode method is not overridden.D、 If a HashSet contains more than one Person object with name=”Fred”, then removing anotherperson, also with name=”Fred”, will remove them all.47.What is the result?() A、Compilation fails.B、atom graniteC、granite graniteD、atom granite graniteE、An exception is thrown at runtime.F、atom granite atom granite48.按钮的事件处理类的主要作用是什么?()A、根据用户点击及时修改按钮的外观B、监听用户对按钮的点击,及时作出响应C、展示按钮点击时的动画效果D、设置按钮对哪一类事件有反应49.下面有关JVM内存,说法错误的是()。A、程序计数器是一个比较小的内存区域,用于指示当前线程所执行的字节码执行到了第几行,是线程隔离的B、Java方法执行内存模型,用于存储局部变量,操作数栈,动态链接,方法出口等信息,是线程隔离的C、方法区用于存储JVM加载的类信息、常量、静态变量、即使编译器编译后的代码等数据,是线程隔离的D、原则上讲,所有的对象都在堆区上分配内存,是线程之间共享的50.For a given ServletResponse response,which two retrieve an object for writing text data?()A、response.getWriter()B、response.getOutputStream()C、response.getOutputWriter()D、response.getWriter().getOutputStream()E、response.getWriter(Writer.OUTPUT_TEXT)51.下列叙述正确的是哪项?()A、事件继承模型取代事件委托模型B、事件继承模型比事件委托模型更加高效C、事件委托模型使用事件监听器来定义事件处理类的方法D、事件委托模型使用handleEvent()方法来支持事件处理52.类中不允许定义私有的构造函数53.public class test ( public static void main(string args) { int 1= 0; while (i) { if (i==4) { break; } ++i; } } ) What is the value of i at line 10?()A、 0B、 3C、 4D、 5E、 The code will not compile.54.以下关于Java文件名的叙述,正确的有?()A、Java源文件的扩展名应为.javaB、Java源文件的文件名应与文件中的类名一致C、Java字节码文件的扩展名应为.javaD、一个Java源文件中只能包含一个Java类55.关于object类,以下描述中正确的有()A、object类中定义了一些重要的成员函数和变量,以方便JAVA类的使用B、object类是所有其他JAVA类的直接或间接父类C、object类是一个非常特殊的“虚拟”类,也就是说,你只能丛object类中派生出其他类,但不能创建一个object类的对象。D、如果一个类已经有了父类,那么这个类同时继承了object类,也就是说,这时候这个类实际上有2个父类E、由于JAVA中的类是单继承的,因此所有的类以object类为根形成了一棵继承树56.A developer is designing a web application that makes many fine-grained remote data requests for eachclient request. During testing, the developer discovers that the volume of remote requests significantlydegrades performance of the application. Which design pattern provides a solution for this problem?()A、FlyweightB、Transfer ObjectC、Service LocatorD、Dispatcher ViewE、Business DelegateF、Model-View-Controller57.有一个三位数满足下列条件: (1)三位数字各不相同; (2)此数等于它的各位数字的立方和。求这种三位数的个数58.程序员正在进行一个项目,必须实现equals方法与所给的hashCode方法协调运行: public int hashCode() { return (size.hashCode() + color.hashCode()) * 17; } 哪一个equals方法支持此目标?() A、 无法确定B、 public boolean equals(Object o) { Sock s = (Sock) o; return size.equals(s.size);}C、 public boolean equals(Object o) { Sock s = (Sock) o; return color.equals(s.color);}D、 public boolean equals(Object o) { Sock s = (Sock) o; return size.equals(s.size) &&color.equals(s.color); }59.11.publicclassCommander{ 12.publicstaticvoidmain(String[]args){ 13.StringmyProp=/*insertcodehere*/ 14.System.out.println(myProp); 15.} 16.} andthecommandline: java-Dprop.custom=gobstopperCommander Whichtwo,placedonline13,willproducetheoutputgobstopper?()A、System.load("prop.custom");B、System.getenv("prop.custom");C、Sperty("prop.custom");D、System.getProperty("prop.custom");E、System.getProperties().getProperty("prop.custom");60.在一个弹性布局的面板中,如果有10个组件的话,最少需要多少条约束?() A、10条B、22条C、2条D、40条61.byte [] arry1, array2[]; byte array3 [][]; byte[][] array4; If each array has been initialized, which statement will cause a compiler error?() A、 Array2 = array1;B、 Array2 = array3;C、 Array2 = array4;D、 Both A and BE、 Both A and CF、 Both B and C62.Click the Exhibit button. The h:highlight tag renders its body, highlighting an arbitrary number of words, each of which is passed asan attribute (word1, word2, ...). For example, a JSP page can invoke theh:highlight tag as follows: 11. 12. high medium low 13. Given that HighlightTag extends SimpleTagSupport,which three steps are necessary to implement the taghandler for the highlight tag?()A、Add a doTag methodB、Add a doStartTag methodC、Add a getter and setter for the color attributeD、Create and implement a TagExtraInfo classE、Implement the DynamicAttributes interfaceF、Add a getter and setter for the word1 and word2 attributes63.CLASSPATH中的“.”的含义是哪项?() A、省略号B、当前目录C、所有目录D、上级目录64.String a = null; a.concat(“abc”); a.concat(“def”); System.out.println(a); What is the result?() A、 abcB、 nullC、 abcdefD、 Compilation fails.E、 The code runs with no output.F、 An exception is thrown at runtime.65.程序员想要创建一个名为MyThread的类以便在main方法中用Thread实例化。对于下面三行: MyThread必须继承Thread。 MyThread必须实现Thread。 MyThread必须覆盖public void run()。 有几行是正确的() A、 0B、 1C、 2D、 366.A web application contains a tag file called beta.tag in /WEB-INF/tags/alpha. A JSP page called sort.jspexists in the web application and contains only this JSP code: 1. 3. The sort.jsp page is requested. Which two are true?()A、Tag files can only be accessed using a tagdir attribute.B、The sort.jsp page translates successfully and invokes the tag defined by beta.tag.C、The sort.jsp page produces a translation error because a taglib directive must always have a uriattribute.D、Tag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB- INF/tags.E、The tagdir attribute in line 2 can be replaced by a uri attribute if a TLD referring to beta.tag is createdand added to the web application.67.以下变量类型中,不属于简单变量类型的是()A、一串字符串;B、一个逻辑值;C、一个字符;D、双精度浮点数;68.interface Altitude { //insert code here } 和4个声明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分别插入到第2行,有多少行可以编译?() A、 0B、 1C、 2D、 3E、 469.class BaseClass{ private float x= 1.0f; protected void setVar (float f) {x = f;} } class SubClass exyends BaseClass { private float x = 2.0f; //insert code here 8. } Which two are valid examples of method overriding?()A、 Void setVar(float f) {x = f;}B、 Public void setVar(int f) {x = f;}C、 Public void setVar(float f) {x = f;}D、 Public double setVar(float f) {x = f;}E、 Public final void setVar(float f) {x = f;}F、 Protected float setVar() {x=3.0f; return 3.0f; }70.55.int[]x={1,2,3,4,5}; 56.inty[]=x; 57.System.out.println(y[2]); Whichistrue?() A、Line57willprintthevalue2.B、Line57willprintthevalue3.C、Compilationwillfailbecauseofanerrorinline55.D、Compilationwillfailbecauseofanerrorinline56.71.publicclassYippee2{ staticpublicvoidmain(String[]yahoo){ for(intx=1;xA、abB、bcC、abcD、Compilationfails.E、Anexceptionisthrownatruntime.72.A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result?() A、TeaB、CoffeeC、Coffee TeaD、Compilation fails.E、The code runs with no output.F、An exception is thrown at runtime.73.现有: 1. class Book { 2. private final void read() { System.out.print("book "); } 3. } 4. class Page extends Book { 5. public static void main(String [] args) { 6. // insert code here 7. } 8. private final void read() { System.out.print("page "); } 9. } 和如下三个代码片段( x, y, z ): x. // just a comment y. new Page().read(); z. new Book().read(); 分别插入到第6行,有几个允许代码通过编译并可以运行且无异常?() A、 0B、 1C、 2D、 374.在正方体上任取三个顶点连成三角形,则所得的三角形是直角非等腰三角形的概率为()。A、1/14B、4/7C、2/7D、3/775.以下哪些包是Java标准库中常用的包?() A、java.langB、javax.servlet .httpC、j ava. ioD、java.sql76.public class Test { public static void main(String Args[]) { int i =1, j = 0; switch(i) { case 2: j +=6; case 4: j +=1; default: j +=2; case 0: j +=4; } System.out.println(“j =” +j); } } What is the result? () A、 0B、 2C、 4D、 6E、 9F、 1377.Click the ’Select and Place’ button. Place the events in the order they occur. 78. A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of the com.Company. Product class with a name property of “The Matrix” and price property of 39.95. Given the JSP page code snippet: What is the response output of this JSP page code snippet? ()A、 Default costs 0.0B、 Default costs 49.95C、 Default costs 39.95D、 The Matrix costs 0.0E、 The Matrix costs 49.95F、 The Matrix costs 39.9579.请谈谈对Hibernate的理解,并简要叙述Hibernate的一级缓存和二级缓存。80.A developer has created a special servlet that is responsible for generating XML content that is sent to adata warehousing subsystem. This subsystem uses HTTP to request these large data files, which arecompressed by the servlet to save internal network bandwidth. The developer has received a request frommanagement to create several more of these data warehousing servlets. The developer is about to copyand paste the compression code into each new servlet. Which design pattern can consolidate thiscompression code to be used by all of the data warehousing servlets?()A、FacadeB、View HelperC、Transfer ObjectD、Intercepting FilterE、Composite Facade81.Float pi = new Float(3.14f); if(pi>3) { System.out.print(”pi is bigger than 3. “); } else { System.out.print(”pi is not bigger than 3. “); } finally { System.out.println(”Have a nice day.”); } What is the result?() A、 Compilation fails.B、 pi is bigger than 3.C、 An exception occurs at runtime.D、 pi is bigger than 3. Have a nice day.E、 pi is not bigger than 3. Have a nice day.82.package foo; import java.util.Vector; private class MyVector extends Vector { int i = 1; public MyVector() { i = 2; } } public class MyNewVector extends MyVector { public MyNewVector() { i = 4; } public static void main(String args[]) { MyVector v = new MyNewVector(); } } What is the result?()A、 Compilation succeeds.B、 Compilation fails because of an error at line 5.C、 Compilation fails because of an error at line 6.D、 Compilation fails because of an error at line 14.E、 Compilation fails because of an error at line 17.83.Which statement is true?() A、The equals method does NOT properly override the Object.equals method.B、Compilation fails because the private attribute cannot be accessed in line 5.C、To work correctly with hash-based data structures, this class must also implement the hashCode method.D、When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.84.What will be written to the standard output when the following program is run?() public class Qd803 { public static void main(String args[]) { String word = "restructure"; System.out.println(word.substring(2, 3)); } } A、estB、esC、strD、stE、s85.建立Sochet类的服务器端需要哪些步骤?()A、服务器端对任意指定的IP地址和端口号进行监听B、监听端口,等待客户端的连接C、建立一个服务器端对象,提供监听的端口号D、当获得其它客户端的连接后,停止监听,创建一个Socket类,用于通讯E、服务器端在此端口继续进行监听86.public class MethodOver { private int x, y; private float z; public void setVar(int a, int b, float c){ x = a; y = b; z = c; } } Which two overload the setVar method?() A、 void setVar (int a, int b, float c){ x = a; y = b; z = c; }B、 public void setVar(int a, float c, int b) { setVar(a, b, c); }C、 public void setVar(int a, float c, int b) { this(a, b, c); }D、 public void setVar(int a, float b){ x = a; z = b; }E、 public void setVar(int ax, int by, float cz) { x = ax; y = by; z = cz; }87.public class OuterClass { private double d1 1.0; //insert code here } You need to insert an inner class declaration at line2. Which two inner class declarations are valid?() A、 static class InnerOne { public double methoda() {return d1;} }B、 static class InnerOne { static double methoda() {return d1;} }C、 private class InnerOne { public double methoda() {return d1;} }D、 protected class InnerOne { static double methoda() {return d1;} }E、 public abstract class InnerOne { public abstract double methoda(); }88.Which will declare a method that forces a subclass to implement it?() A、 Public double methoda();B、 Static void methoda (double d1) {}C、 Public native double methoda();D、 Abstract public void methoda();E、 Protected void methoda (double d1){}89.1. class TestA { 2. TestB b; 3. TestA() { 4. b = new TestB(this); 5. } 6. } 7. class TestB { 8. TestA a; 9. TestB(TestA a) { 10. this.a = a; 11. } 12. } 13. class TestAll { 14. public static void main (String args[]) { 15. new TestAll().makeThings(); 16. // ...code continues on 17. } 18. void makeThings() { 19. TestA test = new TestA(); 20. } 21. } Which two statements are true after line 15, before main completes?()A、 Line 15 causes a stack overflow.B、 An exception is thrown at runtime.C、 The object referenced by a is eligible for garbage collection.D、 The object referenced by b is eligible for garbage collection.E、 The object referenced by a is not eligible for garbage collection.F、 The object referenced by b is not eligible for garbage collection.90.public class Base { public static final String FOO = “foo”; public static void main(String[] args) { Base b = new Base(); Sub s = new Sub(); System.out.print(Base.FOO); System.out.print(Sub.FOO); System.out.print(b.FOO); System.out.print(s.FOO); System.out.print(((Base)s).FOO); } } class Sub extends Base {public static final String FOO=bar;} What is the result?() A、 foofoofoofoofooB、 foobarfoobarbarC、 foobarfoofoofooD、 foobarfoobarfooE、 barbarbarbarbarF、 foofoofoobarbarG、 foofoofoobarfoo91.Which JSTL code snippet can be used to perform URL rewriting?()A、’ />B、’ />C、’ />D、’ />92.What is the result?() A、0, 0, 0B、150, 60, 0C、Compilation fails.D、150, 150, 150E、An exception is thrown at runtime.93.为将数组myArray的长度由6改为10,现采取以下编码: int[] myArray = new int[6]; myArray = new int[10]; (覆盖) 代码执行后,以下叙述哪项是正确的?() A、 数组myArray的长度已由6改为10,其中前6个元素的值不变,后四个元素的值为空。B、 数组myArray的长度已由6改为10,其中前6个元素的值不变,后四个元素需再经过初始化后才能使用。C、 数组myArray的长度已由6改为10,原来6个元素的值全部丢失。D、 数组myArray的长度没有变化。94.public class Drink implements Comparable { public String name; public int compareTo(Object o) { return 0; } } and: Drink one = new Drink(); Drink two = new Drink(); = “Coffee”; = “Tea”; TreeSet set = new TreeSet(); set.add(one); set.add(two); A programmer iterates over the TreeSet and prints the name of each Drink object. What is the result?() A、 TeaB、 CoffeeC、 Coffee
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年Gemini优化公司TOP3权威测评:9年资质壁垒与央媒直连如何碾压新入局者
- 烧脑推理密室协议
- 商业活动现场秩序维护协议
- 医疗机构麻精药品管理
- 2025年临沂费县县直医疗卫生事业单位招聘卫生类岗位工作人员考试真题
- 2025年中国海关博物馆人员招聘真题
- 2025年衡阳市南岳区招聘事业单位工作人员考试真题
- 《数控加工编程与操作2》课件-3.1.2 曲面特征简介
- 2026年成都锦江中医专科医院医护人员招聘笔试模拟试题及答案解析
- 2026江西融思科技有限公司第二批岗位招聘11人笔试备考试题及答案详解
- 2026中国航空发动机产业发展现状与技术突破路径研究报告
- MT/T 1083-2025煤矿矿井提升机电控设备技术条件
- (2026版)中华人民共和国民族团结进步促进法
- 2026湖北十堰市房县风雅演艺有限公司演职人员招聘20人备考题库参考答案详解
- 裱花间日常管理工作制度
- 2026年及未来5年市场数据中国智能水杯行业市场深度研究及发展趋势预测报告
- 新一轮千亿斤粮食产能提升行动方案全文
- 2026年市场监管局消费者权益保护岗面试题
- 恒丰银行笔试题库及答案
- 《导游实务》课件-6.1出境旅游领队服务程序
- 健康膳食解码智慧树知到期末考试答案章节答案2024年佳木斯大学
评论
0/150
提交评论