-
Click the Exhibit button.
https://assets.asklib.com/images/image2/2018080113413786465.png
Given this code from Class B:
25.A a1 = new A();
26.A a2 = new A();
27.A a3 = new A();
28.System.out.println(A.getInstanceCount());
What is the result?()
A . Compilation of class A fails.
B . Line 28 prints the value 3 to System.out.
C . Line 28 prints the value 1 to System.out.
D . A runtime error occurs when line 25 executes.
E . Compilation fails because of an error on line 28.
-
A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed. Which two are true? ()
A . A
-
Given the fully-qualified class names: com.foo.bar.Dog com.foo.bar.blatz.Book com.bar.Car com.bar.blatz.Sun Which graph represents the correct directory structure for a JAR file from which those classes can be used by the compiler and JYM?()
A . Jar A
B . Jar B
C . Jar C
D . Jar D
E . Jar E
-
Given a class Repetition:
https://assets.asklib.com/images/image2/2018080111013543546.png
Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?()
A . import utils.*;
B . static import utils.*;
C . import utils.Repetition.*;
D . static import utils.Repetition.*;
E . import utils.Repetition.twice();
F . import static utils.Repetition.twice;
-
Given the following class, which statements can be inserted at position 1 without causing the code to fail compilation?() public class Q6db8 { int a; int b = 0; static int c; public void m() { int d; int e = 0; // Position 1 } }
A . a++;
B . b++;
C . c++;
D . d++;
E . e++;
-
Given the following code: public class Person{ int arr[] = new int[10]; public static void main(String a[]) { System.out.println(arr[1]); } } Which statement is correct?()
A . When compilation some error will occur.
B . It is correct when compilation but will cause error when running.
C . The output is zero.
D . The output is null.
-
Click the Exhibit button.
Given this code from Class B:
25. A a1 = new A();
26. A a2 = new A();
27. A a3 = new A();
28. System.out.println(A.getInstanceCount());
What is the result?()
https://assets.asklib.com/images/image2/2018080115393687033.jpg
A . Compilation of class A fails.
B . Line 28 prints the value 3 to System.out.
C . Line 28 prints the value 1 to System.out.
D . Compilation fails because of an error on line 28.
E . A runtime error occurs when line 25 executes.
-
Click the Exhibit button.
Given:
https://assets.asklib.com/images/image2/2018080115494668194.jpg
Which two statements are true if a NullPointerException is thrown on line 3 of class C?()
https://assets.asklib.com/images/image2/2018080115495053920.jpg
A . The application will crash.
B . The code on line 29 will be executed.
C . The code on line 5 of class A will execute.
D . The exception will be propagated back to line 27.
E . The code on line 5 of class B will execute.
-
Given: 1. public class Method Over { 2. public void set Var (int a, int b, float c) { 3. } 4. } Which two overload the set Var method()?
A . private void set Var(int a, float c, int b) {}
B . protected void set Var(int a, int b, float c) {}
C . public int set Var(int a, float c, int b) {return a:}
D . public int set Var(int a, int b, float c) {return a:}
E . protected float set Var(int a, int b, float c) {return c:}
-
Given the following code: public class Person{ static int arr[] = new int[10]; public static void main(String a[]) { System.out.println(arr[1];) } } Which statement is correct?()
A . When compilation some error will occur.
B . It is correct when compilation but will cause error when running.
C . The output is zero.
D . The output is null.
-
Given a pre-generics implementation of a method:
https://assets.asklib.com/images/image2/2018080110591931008.png
What three changes allow the class to be used with generics and avoid an unchecked warning?()
A . Remove line 14.
B . Replace line 14 with "int i = iter.next();".
C . Replace line 13 with "for (int i : intList) {".
D . Replace line 13 with "for (Iterator iter : intList) {".
E . Replace the method declaration with "sum(List
-
Click the Exhibit button. Given:Which statement is true if a TestException is thrown on line 3 of class B? ()https://assets.asklib.com/images/image2/2018080209451430879.jpg
A . Line 33 must be called within a try block.
B . The exception thrown by method1 in class A is not required to be caught.
C . The method declared on line 31 must be declared to throw a RuntimeException.
D . On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.
-
Click the Exhibit button.
https://assets.asklib.com/images/image2/2018080110493341256.png
Given:
https://assets.asklib.com/images/image2/2018080110494646100.png
Which statement is true if a TestException is thrown on line 3 of class B?()
A . Line 33 must be called within a try block.
B . The exception thrown by method 1 in class A is not required to be caught.
C . The method declared on line 31 must be declared to throw a runtime exception.
D . On line 5 of class A,the call to method 2 of class B does not need to be placed in a try catch block.
-
1. public class A { 2. public String doit(int x, int y) { 3. return “a”; 4. } 5. 6. public String doit(int... vals) { 7. return “b”; 8. } 9. } Given: 25. A a=new A(); 26. System.out.println(a.doit(4, 5)); What is the result?()
A . Line 26 prints “a” to System.out.
B . Line 26 prints „b” to System.out.
C . An exception is thrown at line 26 at runtime.
D . Compilation of class A will fail due to an error in line 6.
-
Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()
A . The class implements java.lang.Comparable.
B . The class implements java.util.Comparator.
C . The interface used to implement sorting allows this class to define only one sort sequence.
D . The interface used to implement sorting allows this class to define many different sort sequences.
-
Given this method in a class: public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(‟<‟); buffer.append(this.name); buffer.append(‟>‟); return buffer.toString(); } Which is true?()
A . This code is NOT thread-safe.
B . The programmer can replace StringBuffer with StringBuilder with no other changes.
C . This code will perform well and converting the code to use StringBuilder will not enhance the performance.
D . This code will perform poorly. For better performance, the code should be rewritten: return “<“+ this.name + “>”;
-
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?()
A . The class implements java.lang.Comparable.
B . The class implements java.util.Comparator.
C . The interface used to implement sorting allows this class to define only one sort sequence.
D . The interface used to implement sorting allows this class to define many different sort sequences.
-
Given a class Repetition:
https://assets.asklib.com/images/image2/2018080116125392704.jpg
Which code should be inserted at line 1 of Demo.java to compile and run Demo to print "pizzapizza"?()
A . import utils.*;
B . static import utils.*;
C . import utils.Repetition.*;
D . static import utils.Repetition.*;
E . import utils.Repetition.twice();
F . import static utils.Repetition.twice;
G . static import utils.Repetition.twice
-
Given that Thing is a class, how many objects and reference variables are created by the following code?() Thing item, stuff; item = new Thing(); Thing entity = new Thing();
A . One object is created
B . Two objects are created
C . Three objects are created
D . One reference variable is created
E . Two reference variables are created
F . Three reference variables are created.
-
听力原文:I haven't got a class card for biology because registration for students whose last names begin with "W" doesn't start until tomorrow.
(22)
A.It's a bit too early to get a class card for me.
B.I misplaced my class card for biology.
C.I missed registration.
D.My last name is so strange that few people could pronounce it.
-
For this part, you are allowed 30 minutes to write a short essay entitled Class Attendance. You should write at least 150 words according to the outline given below in Chinese:
1.有人认为大学生必须去上课
2.有人认为不应该强迫大学生上课
3.我认为…
Class Attendance
-
In your first days at the school you’ll be given a test to help the teachers to ________ you to a class at your level.
A) locate
B) assign
C) deliver
D) place
-
Click the Exhibit button. Given:Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()
<img src='https://img2.soutiyun.com/ask/uploadfile/2019-03-27/900591de4611848eaa661230b23f7c01.jpg' />
<img src='https://img2.soutiyun.com/ask/uploadfile/2019-03-27/096a8f1a86972212e5c4d4c53f88ec71.jpg' />
A.The application will crash.
B.The code on line 29 will be executed.
C.The code on line 5 of class A will execute.
D.The code on line 5 of class B will execute.
E.The exception will be propagated back to line 27.
-
Given the uncompleted code of a class:class Person { String name, department; int age; public Person(String n){ name = n; } public Person(String n, int a){ name = n; age = a; } public Person(String n,
A.Person(n,a)
B.this(Person(n,a))
C.this(n,a)
D.this(name,age)