JAVA 6

COEP
Lets Crack Online Exam

IT Interview Exam Questions: JAVA 6 (IT Campus Placement)

Subject: JAVA 6

Part 6: List for questions and answers of JAVA

 

Q1. Which one of these lists contains only Java programming language keywords?

a) class, if, void, long, Int, continue

b) goto, instanceof, native, finally, default, throws

c) try, virtual, throw, final, volatile, transient

d) strictfp, constant, super, implements, do

 

Q2. Which will legally declare, construct, and initialize an array?

a) int [] myList = {“1”, “2”, “3”};

b) int [] myList = (5, 8, 2);

c) int myList [] [] = {4,9,7,0};

d) int myList [] = {4, 3, 7};

 

Q3. Which is a reserved word in the Java programming language?

a) method

b) native

c) subclasses

d) reference

 

Q4. Which is a valid keyword in java?

a) interface

b) string

c) Float

d) unsigned

 

Q5. Which three are legal array declarations?

1.int [] myScores [];

2.char [] myChars;

3.int [6] myScores;

4.Dog myDogs [];

a) 1,2,4

b) 2,4,5

c) 2,3,4

d) All are correct 

 

Q6. Which of these method of class String is used to extract a single character from a String object?

a) CHARAT()

b) charat()

c) charAt()

d) ChatAt()

 

Q7. Which one of the following will declare an array and initialize it with five numbers?

a) Array a = new Array(5);

b) int [] a = {23,22,21,20,19};

c) int a [] = new int[5];

d) int [5] array;

 

Q8. Which three are valid declarations of a char?

1.char c1 = 064770;

2.char c2 = ‘face’;

3.char c3 = 0xbeef;

4.char c4 = \u0022;

a) 1, 2, 4

b) 1, 3

c) 3, 5

d) 2 only

 

Q9. Which is the valid declarations within an interface definition?

a) public double methoda();

b) public final double methoda();

c) static void methoda(double d1);

d) protected void methoda(double d1);

 

Q10. Which one is a valid declaration of a boolean?

a) boolean b1 = 0;

b) boolean b2 = ‘false’;

c) boolean b3 = false;

d) boolean b5 = no; 

 

Q11. Which three are valid declarations of a float?

1.float f1 = -343;

2.float f2 = 3.14;

3.float f3 = 0x12345;

4.float f4 = 42e7;

a) 1,2,4

b) 2,3

c) 1,3

d) 2,4

 

Q12. Which is a valid declarations of a String?

a) String s1 =null;

b) String s2 =’null’;

c) String s3 =(String)’abc’;

d) String s4 =(String)’\ufeed’;

 

Q13. What is the numerical range of a char?

a) -128 to 127

b) -(215) to (215)-1

c) 0 to 32767

d) 0 to 65535

 

Q14. Which metrhods are utilized to control the access to an object in multi threaded programming

a) Asynchronized methods

b) Synchronized methods

c) Serialized methods

d) None of above

 

Q15. Which of the following below are valid isolation levels in J2EE

a) TRANSACTION_READ_UNCOMMITTED

b) TRANSACTION_SERIALIZABLE

c) Only A

d) Both A and B

 

Q16. Program which executes applet is known as

a) applet engine

b) virtual machine

c) JVM

d) None of above 

 

Q17. All raw data types should be read and uploaded to the database as an array of

a) int

b) char

c) boolean

d) byte

 

Q18. The class java.sql.Timestamp is associated with

a) java.util.Time

b) java.sql.Time

c) java.util.Date

d) None of above

 

Q19. Which of the following statements about arrays is syntactically wrong

a) arrayName[]p=new arrayName[5];

b) arrayName p[5];

c) arrayName[] p[];

d) arrayName p[][]=new arrayName[2][];

 

Q20. Converting a primitive type data into its corresponding wrapper class object instance is called

a) boxing

b) wrapping

c) instantiation

d) autoboxing 

 

Part 6: List for questions and answers of JAVA

 

Q1. Answer: b

 

Q2. Answer: d

 

Q3. Answer: b

 

Q4. Answer: a

 

Q5. Answer: a

 

Q6. Answer: c

 

Q7. Answer: b

 

Q8. Answer: b

 

Q9. Answer: a

 

Q10. Answer: c

 

Q11. Answer: c

 

Q12. Answer: a

 

Q13. Answer: d

 

Q14. Answer: a

 

Q15. Answer: d

 

Q16. Answer: a

 

Q17. Answer: d

 

Q18. Answer: d

 

Q19. Answer: d

 

Q20. Answer: d