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: Payment for imports and exports is made through a system called foreign exchange.
P : The value of the money of one country in relation to the money of other countries is agreed upon.
Q : These rates of exchange vary from time to time.
R : For instance, an American dollar or a British pound sterling is worth certain amounts in the money of other countries.
S : Sometimes a United States dollar is worth 12 pesos in Mexico.
S6: Another time it may be worth eight pesos.
The Proper sequence should be:

A PQRS

B QPRS

C PRQS

D RPQS

Q2: If int is 2 bytes wide.What will be the output of the program?
#include <stdio.h>
void fun(char**);

int main()
{
    char *argv[] = {"ab", "cd", "ef", "gh"};
    fun(argv);
    return 0;
}
void fun(char **p)
{
    char *t;
    t = (p+= sizeof(int))[-1];
    printf("%s\n", t);
}

A ab

B cd

C ef

D gh

Q3: Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?

A final

B static

C private

D protected

E volatile

Q4: Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?

A final

B static

C private

D protected

E volatile

Q5: Which is a valid declaration within an interface?

A public static short stop = 23;

B protected short stop = 23;

C transient short stop = 23;

D final void madness(short stop);

Q6: What will be the output of the program?
class A 
{
    final public int GetResult(int a, int b) { return 0; } 
} 
class B extends A 
{ 
    public int GetResult(int a, int b) {return 1; } 
} 
public class Test 
{
    public static void main(String args[]) 
    { 
        B b = new B(); 
        System.out.println('x = ' + b.GetResult(0, 1));  
    } 
}

A x = 0

B x = 1

C Compilation fails.

D An exception is thrown at runtime.

Q7: What will be the output of the program?
public class Test 
{  
    public static void main(String args[])
    { 
        class Foo 
        {
            public int i = 3;
        } 
        Object o = (Object)new Foo();
        Foo foo = (Foo)o;
        System.out.println('i = ' + foo.i);
    }
}

A i = 3

B Compilation fails.

C i = 5

D A ClassCastException will occur.

Q8: What will be the output of the program?
public class A
{ 
    void A() /* Line 3 */
    {
        System.out.println('Class A'); 
    } 
    public static void main(String[] args) 
    { 
        new A(); 
    } 
}

A Class A

B Compilation fails.

C An exception is thrown at line 3.

D The code executes with no output.

Q9: What will be the output of the program?
class Super
{ 
    public int i = 0; 

    public Super(String text) /* Line 4 */
    {
        i = 1; 
    } 
} 

class Sub extends Super
{
    public Sub(String text)
    {
        i = 2; 
    } 

    public static void main(String args[])
    {
        Sub sub = new Sub('Hello'); 
        System.out.println(sub.i); 
    } 
}

A 0

B 1

C 2

D Compilation fails.

Q10: What will be the output of the program?
public class Test 
{
    public int aMethod()
    {
        static int i = 0;
        i++;
        return i;
    }
    public static void main(String args[])
    {
        Test test = new Test();
        test.aMethod();
        int j = test.aMethod();
        System.out.println(j);
    }
}

A 0

B 1

C 2

D Compilation fails.