Select The Packages in Which JDBC Classes Are Defined?
Select The Packages in Which JDBC Classes Are Defined?
a) O (n) b) O (n2)
C) O (n!) d) O (logn)
c) 5 d) 6
c) InputStreamReader d) DataInputStream
6. Which class can be used to read data line by line using the readLine() method?
a) BufferedReader b) InputStreamReader
c) Package d) Object
a) The code has compile errors because the variable arr cannot be changed once it is assigned.
b) The code has runtime errors because the variable arr cannot be changed once it is assigned.
c) The code can compile and run fine. The second line assigns a new array to arr.
d) The code has compile errors because we cannot assign a different size array to arr.
a[1] = 1;
a = new int[2];
c) a[1] is 0
d) a[1] is 1
11. What is the value of a[1] after the following code is executed?
int[] a = {0, 2, 4, 1, 3};
A) 0
B) 1
C) 2
D) 3
E) 4
12. What would be the result of attempting to compile and run the following code?
a) The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should
be replaced by {1, 2, 3}.
b) The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should
be replaced by new double[3]{1, 2, 3};
c) The program has a compile error because the syntax new double[]{1, 2, 3} is wrong and it should
be replaced by new double[]{1.0, 2.0, 3.0};
d) The program compiles and runs fine and the output is 2.0
13. What is the output for the below code?
int i = 010;
int j = 07;
System.out.println(i);
System.out.println(j);
a) 8
b) 10
byte i = 128;
System.out.println(i);
a) 128
b) 0
int i=8;
int j=9;
add();
int k = i+j;
System.out.println(k);
a) 17
b) 0
a) 24
b) 42
c) 23
d) 32
1) The speed of a boat in still water is 5km/hr. If the speed of the boat against the stream is 3 km/hr, what is the speed
of the stream?
a) 1.5 km/hr
b) 2 km/hr
c) 2.5 km/hr
d) 1 km/hr
A pipe can fill a tank in 6 hours and another pipe can empty the tank in 12 hours. If both the pipes are opened at the
same time, the tank can be filled in
a) 10 hours
b) 12 hours
c) 14 hours
d) 16 hours
Three pipes A, B and C can fill a cistern in 8 minutes,12 minutes and 16 minutes respectively. What is the time taken by
three pipes to fill the cistern when they are opened together?
a) 3.7 minutes
b) 4 minutes
c) 4.5 minutes
d) 5 minutes
Two pipes working together can fill a fish tank in 12 minutes. If one pipe fills the fish tank 10 minutes faster than the
second pipe, in what time the second pipe alone can fill the fish tank?
a) 20 minutes
b) 25 minutes
c) 30 minutes
d) 35 minutes
Two boys start running at the same time in the same direction at a speed of 10 km/hr and 12 km/hr respectively. In what
time they will be 8 km apart?
a) 3 hours
b) 4 hours
c) 5 hours
d) 6 hours
A horse covers a certain distance in 40 minutes if it runs at a speed of 60 km/hr. At what speed the horse can cover the
same distance in 30 minutes?
a) 80 km/hr
b) 82 km/hr
c) 84 km/hr
d) 86 km/hr
In a bag, there are 8 red, 7 yellow and 6 green balls. If one ball is picked up at random, what is the probability that it is
neither red nor green?
e) 1/4
f) 1/2
g) 1/5
h) 1/3
In a group of students, there are 15 boys and 10 girls. If three students are selected at random, what is the probability
that 1 girl and 2 boys are selected?
a) 21/46
b) 21/36
c) 21/26
d) 21/56
A man draws two cards together from a pack of 52 cards. What is the probability of both the cards being kings?
e) 1/111
f) 1/121
g) 1/221
h) 1/321
Average of five numbers is 20. If each number is multiplied by 2, what will be the new average?
A. 30
B. 40
C. 50
D. 60
If the average of three consecutive even numbers is 34, find the largest of these numbers.
A. 30
B. 32
C. 34
D. 36
If the number 467X4 is divisible by 9, find the value of the digit marked as X.
a) 4
b) 5
c) 6
d) 7
45 ? = 35% of 900
a) 6
b) 7
c) 9
d) 4
a) 300
b) 320
c) 375
d) 400
a) 37
b) 73
c) 43
d) 83