21. which of the following are characteristic of a fully encapsulated class?
a. all variables are private(*)
b. all methods are private
c. methods are provided to access the class's properties(*)
d. the class's design may be changed with minimal impact on its implementation
22. which of the following are true about the finally clause of a try-catch-finally statement?
a. it is only executed after a catch clause has executed
b. it is only executed if a catch clause has not executed
c. it is always executed unless its thread terminates(*)
it is only executed if an exception is thrown
23. which layout stacks components on tope of each other?
a. cardlayout(*)
b. null layout
c. borderlayout
d. setlayout
24. which of the following components generate action events?
a. buttons(*)
b. labels
c. checkboxes
d. windows
25. which methods will cause a frame to be displayed?
a. show() (*)
b. setVisible() (*)
c. display()
d. displayFrame()
26. what is the range of the short type?
a. 0 to 2^16
b. -(2^16) to 2^16
c. -(2^15) to 2^15
d. -(2^15) to 2^15-1 (*)
27. what is the value of a[3] as the result of the following array declaration?
int[] a={1,2,3,4,5};
a.1
b.2
c.3
d.4(*)
28. what is the output of the following program?
public class question {
public static void main(String args[]) {
boolean[] b = new boolean[2];
double[] d = new double[2];
System.out.print(b[0]);
System.out.println(d[1]);
a. true0.0
b. true0
c. false0.0 (*)
d. false0
29. what is the output of the following program?
class question {
static int i=1,j=2;
static {
display(i);
}
public static void main(String args[]) {
display(j);
static void display(int n) {
system.out.print(n);
}
}
a. 1
b. 2
c. 12(*)
d. 21
30. which of the following are true?
a. a top-level class may be declared as private
b. a method may be declared as transient
c. a constructor may be declared as volatile
d. a local variable may be declared as final(*)
a. all variables are private(*)
b. all methods are private
c. methods are provided to access the class's properties(*)
d. the class's design may be changed with minimal impact on its implementation
22. which of the following are true about the finally clause of a try-catch-finally statement?
a. it is only executed after a catch clause has executed
b. it is only executed if a catch clause has not executed
c. it is always executed unless its thread terminates(*)
it is only executed if an exception is thrown
23. which layout stacks components on tope of each other?
a. cardlayout(*)
b. null layout
c. borderlayout
d. setlayout
24. which of the following components generate action events?
a. buttons(*)
b. labels
c. checkboxes
d. windows
25. which methods will cause a frame to be displayed?
a. show() (*)
b. setVisible() (*)
c. display()
d. displayFrame()
26. what is the range of the short type?
a. 0 to 2^16
b. -(2^16) to 2^16
c. -(2^15) to 2^15
d. -(2^15) to 2^15-1 (*)
27. what is the value of a[3] as the result of the following array declaration?
int[] a={1,2,3,4,5};
a.1
b.2
c.3
d.4(*)
28. what is the output of the following program?
public class question {
public static void main(String args[]) {
boolean[] b = new boolean[2];
double[] d = new double[2];
System.out.print(b[0]);
System.out.println(d[1]);
a. true0.0
b. true0
c. false0.0 (*)
d. false0
29. what is the output of the following program?
class question {
static int i=1,j=2;
static {
display(i);
}
public static void main(String args[]) {
display(j);
static void display(int n) {
system.out.print(n);
}
}
a. 1
b. 2
c. 12(*)
d. 21
30. which of the following are true?
a. a top-level class may be declared as private
b. a method may be declared as transient
c. a constructor may be declared as volatile
d. a local variable may be declared as final(*)
No comments:
Post a Comment