当前分类: OCJP(310-065)
问题:单选题Given: What is the result?()A 2B 24C 234D 246E 2346...
查看答案
问题:单选题Given the following directory structure: bigProject |--source ||--Utils.java| |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result?()A If the compile ...
问题:单选题Given: 11.double input = 314159.26; 12.NumberFormat nf = NumberFormat.getInstance(Locale.ITALIAN); 13.String b; 14.//insert code here Which code, inserted at line 14, sets the value of b to 314.159,26?()A b = nf.parse( input );B b = nf.format( input );...
问题:单选题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 11.public interface Status { 12./* insert code here */ int MY_VALUE = 10; 13.} Which three are valid on line 12?()AfinalBstaticCnativeDpublicEprivate...
问题:单选题Given: What is the result?()A 2.1.0B 2.1.1C 3.2.1D 3.2.2...
问题:单选题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: 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...
问题:单选题Given: Which code, inserted at line 14, allows the Sprite class to compile?()A Direction d = NORTH;B Nav.Direction d = NORTH;C Direction d = Direction.NORTH;D Nav.Direction d = Nav.Direction.NORTH;...
问题:多选题Which three will compile and run without exception?()Aprivate synchronized Object o;Bvoid go() {synchronized() { /* code here */ }Cpublic synchronized void go() { /* code here */ }Dprivate synchronized(this) void go() { /* code here */ }Evoid go() {syn...
问题:单选题Given: What is the result?()A b 3B b 8C b 13D f 3...
问题:单选题A company that makes Computer Assisted Design (CAD) software has, within its application, some utilityclasses that are used to perform 3D rendering tasks. The company’s chief scientist has just improved theperformance of one of the utility classes’ key...
问题:单选题Given: What is the result?()A 23B 234C 235D Compilation fails....
问题:单选题Given: What is the result?()A BB The code runs with no output.C Compilation fails because of an error in line 12.D Compilation fails because of an error in line 15.E Compilation fails because of an error in line 18....
问题:多选题Given: Which two statements are true?()AThe output could be 8-1 7-2 8-2 7-1BThe output could be 7-1 7-2 8-1 6-1CThe output could be 8-1 7-1 7-2 8-2DThe output could be 8-1 8-2 7-1 7-2...
问题:单选题Given: What is the result?()A test endB Compilation fails.C test runtime endD test exception endE A Throwable is thrown by main at runtime....
问题:单选题Given: Which statement 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...
问题:多选题Given: 35.String #name = "Jane Doe"; 36.int $age = 24; 37.Double _height = 123.5; 38.double ~temp = 37.5; Which two statements are true?()ALine 35 will not compile.BLine 36 will not compile.CLine 37 will not compile.DLine 38 will not compile....
问题:多选题Given: Which four code fragments, inserted independently at line 7, will compile?()Apublic void m1() { }Bprotected void m1() { }Cprivate void m1() { }Dvoid m2() { }Epublic void m2() { }Fprotected void m2() { }...