问题:单选题Given the following six method names: add Listener add Mouse Listener set Mouse Listener delete Mouse Listener remove Mouse Listener register Mouse Listener How many of these method names follow JavaBean Listener naming rules?()A 1B 2C 3D 4...
查看答案
问题:单选题Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("/s"); 13.System.out.println(tokens.length); What is the result?()A 0B 1C 4D Compilation fails....
问题:单选题Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()A The va...
问题:单选题Given that the elements of a PriorityQueue are ordered according to natural ordering,and: What is the result?()A apple pearB banana pearC apple appleD apple bananaE banana banana...
问题:多选题Given: And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to "." (current directory). Which two java commands entered at the commandline will run MainClass?()Ajava MainClass if run fro...
问题:单选题A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods ...
问题:多选题Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object?()AWhen using versions of Java technology earlier than 5.0.BWhen sharing a StringBuffer among multiple threads.CWhen using the java.io class StringBufferInput...
问题:单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} 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 Target...
问题:多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Bookclass?()AThe JAR fi...
问题:多选题Given: Which two, placed on line 13, will produce the output gobstopper?()ASystem.load("prop.custom");BSystem.getenv("prop.custom");CSystem.property("prop.custom");DSystem.getProperty("prop.custom");ESystem.getProperties().getProperty("prop.custom");...
问题:单选题Which statement is true?()A A class’s finalize() method CANNOT be invoked explicitly.B super.finalize() is called implicitly by any overriding finalize() method.C The finalize() method for a given object is called no more than once by the garbage colle...
问题:多选题Given a class whose instances, when found in a collection of objects, are sorted by using the compare To method, which two statements are true?()AThe class implements java.lang.Comparable.BThe class implements java.util.Comparator.CThe interface used t...
问题:单选题Which can appropriately be thrown by a programmer using Java SE technology to create a desktop application?()A ClassCastExceptionB NullPointerExceptionC NoClassDefFoundErrorD NumberFormatExceptionE ArrayIndexOutOfBoundsException...
问题:单选题Given a valid DateFormat object named df,and 16.Date d = new Date(0L); 17.String ds = "December 15, 2004"; 18.//insert code here What updates d’s value with the date represented by ds?()A 18. d = df.parse(ds);B 18. d = df.getDate(ds);C 18. try {19. d =...
问题:单选题Given: What is the result?()A Compilation succeeds.B Compilation fails due to multiple errors.C Compilation fails due to an error only on line 20.D Compilation fails due to an error only on line 21.E Compilation fails due to an error only on line...
问题:单选题Given: String[] elements = { "for", "tea", "too" }; String first = (elements.length 0) ? elements[0] : null; What is the result?()A Compilation fails.B An exception is thrown at runtime.C The variable first is set to null.D The variable first is set t...
问题:多选题Given: Which two methods, inserted independently at line 17, correctly complete the Sales class?()Adouble getSalesAmount() { return 1230.45; }Bpublic double getSalesAmount() { return 1230.45; }Cprivate double getSalesAmount() { return 1230.45; }Dprote...
问题:单选题Given: 22.StringBuilder sb1 = new StringBuilder("123"); 23.String s1 = "123"; 24.// insert code here 25.System.out.println(sb1 + " " + s1); Which code fragment, inserted at line 24, outputs "123abc 123abc"?()A sb1.append(abc); s1.append(abc);B sb1.appe...