Вы находитесь на странице: 1из 4

1. Which three are methods of the Object class?

1) notify();
2) notifyAll();
3) isInterrupted();
4) synchronized();
5) interrupt();
6) wait(long msecs);
7) sleep(long msecs);
8) yield();

A. 1, 2, 4

B. 2, 4, 5

C. 1, 2, 6

D. 2, 3, 4

2.The element indices of an array can be computed at


A. cannot be computed
B. compile time
C. run time
D. both b and c

3.Which is the fastest sorting algorithm to sort a list?


A. Quick sort
B. Bubble sort
C. Binary sort
D. Linear sort

4.A package is a namespace for organizing _____________ and interfaces in a logical


manner
A. instance
B. object
C. classes
D. both b and c above
5.What makes a class abstract?
A. The class must not have method definitions.
B. The class must have a constructor that takes no arguments.
C. The class must have a function definition equal to zero.
D. The class which cannot be instantiated as they are mainly for inheritance.

6.One that can be modified by the class even when the object of the class or the member
function doing the modification is const it is known as______________
A. member function
B. mutable member
C. constant member
D. none of these

7.Which one is true in case of collections?


A. A Set will not allow duplicate elements
B. A List will allow duplicate elements
C. both a and b
D. Neither a nor b

8.Which of the following operators below have the highest priority when evaulating?
A. ()
B. []
C. *
D. ->

9. Which of the following operation(s) is/are required to convert the java source code into
output form.

A. Compilation
B. interpretation
C. both a and b
D. none of these

10. SQL query and modification commands make up a(n) ________ .


A. DDL
B. DML
C. HTML
D. XML

11.What value of c will get printed


main()
{
int a, b, c;
a = 10;
b = 20;
c = printf("%d",a) + ++b;
printf ("%d",c);
}

A. 22
B. 23
C. 30
D. Compilation Error

12.What are storage classes in 'C' language? choose multiple-


a) auto keyword
b) static keyword
c) register keyword
d) extern keyword
e) automatic
f) static

A. a,b,c
B. a,b,c,d
C. e,f
D. None of the above

13.What happens when the following code is compiled and run. Select the one correct
answer.
for(int i = 1; i < 3; i++)
for(int j = 3; j > i; j--)
assert i!=j {System.out.println(i); }

A) The class compiles and runs, but does not print anything.
B) The number 1 gets printed with AssertionError
C) The program generates a compilation error
D) The number 2 gets printed with AssertionError
14.What gets printed when the following code is compiled and run with the following
command - java test 2 Select the one correct answer.

public class test {


public static void main(String args[]) {
Integer intObj=Integer.valueOf(args[args.length-1]);
int i = intObj.intValue();

if(args.length > 1)
System.out.println(i);
if(args.length > 0)
System.out.println(i - 1);
else
System.out.println(i - 2);
}
}

A. test
B. test-1
C. 0
D. 1

15.With round robin scheduling algorithm in a time shared system,

A. using very large time slices converts it into First come First served scheduling algorithm

B. using very small time slices converts it into First come First served scheduling algorithm

C. using extremely small time slices increases performance

D. using very small time slices converts it into Shortest Job First algorithm

Вам также может понравиться