image not found

Oops! That page can't be found.


Directions to Solve

In questions below, each passage consist of six sentences. The first and sixth sentence are given in the begining. The middle four sentences in each have been removed and jumbled up. These are labelled as P, Q, R and S. Find out the proper order for the four sentences.

Q1:
S1: Far away in a little street there is a poor house.
P : Her face is thin and worn and her hands are coarse, pricked by a needle, for she is a seam stress.
Q : One of the windows is open and through it I can see a poor woman.
R : He has a fever and asking for oranges.
S : In a bed in a corner of the room her little boy is lying ill.
S6: His mother has nothing to give but water, so he is crying.
The Proper sequence should be:

A RSPQ

B SRQP

C PQSR

D QPSR

Q2: Point out the error in the program
#include<stdio.h>
int f(int a)
{
  a > 20? return(10): return(20);
}
int main()
{
    int f(int);
    int b;
    b = f(20);
    printf("%d\n", b);
    return 0;
}

A No error

B None of above

C Error: Prototype declaration

D Error: return statement cannot be used with conditional operators

Q3: Which interface provides the capability to store objects using a key-value pair?

A Java.util.Set

B Java.util.Map

C Java.util.Collection

D Java.util.List

Q4: Which collection class allows you to associate its elements with key values, and allows you to retrieve objects in FIFO (first-in, first-out) sequence?

A java.util.LinkedHashMap

B java.util.TreeMap

C java.util.HashMap

D java.util.ArrayList

Q5: Which collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?

A java.util.Hashtable

B java.util.TreeMap

C java.util.SortedMap

D java.util.TreeSet

Q6: Which is valid declaration of a float?

A float f = 1.0;

B float f = "1";

C float f = 1F;

D float f = 1.0d;

Q7:
/* Missing Statement ? */
public class foo 
{
    public static void main(String[]args)throws Exception 
    {
        java.io.PrintWriter out = new java.io.PrintWriter(); 
        new java.io.OutputStreamWriter(System.out,true); 
        out.println('Hello'); 
    } 
}
What line of code should replace the missing statement to make this program compile?

A include java.io.*;

B No statement required.

C import java.io.PrintWriter;

D import java.io.*;

Q8: What is the numerical range of char?

A -32768 to 32767

B 0 to 65535

C 0 to 32767

D -256 to 255

Q9:
Which of the following are Java reserved words?
  1. run
  2. import
  3. default
  4. implement

A 2 and 3

B 3 and 4

C 2 and 4

D 1 and 2

Q10: What will be the output of the program?
public class Test 
{ 
    public static void main (String[] args) 
    {
        String foo = args[1]; 
        String bar = args[2]; 
        String baz = args[3]; 
        System.out.println('baz = ' + baz); /* Line 8 */
    } 
}
And the command line invocation: > java Test red green blue

A baz = blue

B baz =

C baz = null

D Runtime Exception