Sep 28, 2008

MOBILE TECHNOLOGIES" Java - Interview Questions

1. Which two of the following legal objectives for non tested clauses and interfaceA. final abstract class test {}
B. public static interface test {}
C. final public class test {}
D. procted abstract class test {}
E. procted interface class test{}
F. abstract public class test {}

ANSWER: C & F

2. There should be one public class in a file : True/False

ANSWER: True

3. Interface variable are implicity public static final : True/False

ANSWER: True

4. Which two are equal

A. 32/2
B. (82>>2)<<4
C. 2^5
D. 128>>>2
E. (2>>1)*(32>>3)
F. 2>>5

ANSWER
: B & E

5. Public class test
{
Public static void main (string args[])
{
signed int x=10;
for (int y=0 ;y<5;y+1,x--)
}
system.out.print(""+x);
}

ANSWER: Compililation fails signed is not keyword

6. Which is the reserved word in jav programming lang

A. method
B. native
C. sublance
D. reference
E. array

ANSWER: B

7. Which class does not orerride the equal and hash coder methods inheriting thisA. java.long.string
B. java.long.double
C. java.long.string buffer
D. java.long.character
E. java.util.arrays

ANSWER: C

8. Which collections class allows you to grow or shrink size and provides indexed access to elements but whose methods are not sync.A. java.util.hashset
B. java.util.linkedhashset
C. java.util.list
D. java.util.Arryalist
E. java.util.vectar

ANSWER: D

9. Which state is true

A. calling runtime.g © will cause objects 1 to be grabage collects
B. the garbge collector uses a marce and sweep alga.
C. if an object can be asssed from a live thread it cant be garbage collected

ANSWER: B & C

9. What is the numerical range of occur

A. -128 to 127
B. -(2^15) to (2^15)-1
C. 0 to 32767
D. platform deiendent
E. 0 to 65535

ANSWER: E

10. What is the most restrictive access modifer that will allow members of one class to have access to membersof another class in same packageA. public
B. abstract
C. protected
D. synchronized
E. defaut acccess

ANSWER: E

11. Given a methed proctected, class what access modifer do you use to restrict access that method to only the other members of the same classA. final
B. static
C. private
D. protected
E. volatile
F. defaut access

ANSWER: C

12. int I= 0
label
if(I<2)
system.out.print("I is" +I);
I++;
continue label


ANSWER: Complution error.

No comments: