JAVA 20

COEP
Lets Crack Online Exam

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

Subject: JAVA 20

Part 20: List for questions and answers of JAVA

 

Q1. Which of the following class is not included in java.lang?

a) Byte

b) Integer

c) Array

d) Class

 

Q2. Which of these is a process of converting a simple data type into a class?

a) type wrapping

b) type conversion

c) type casting

d) None of the Mentioned

 

Q3. Which of these is a super class of wrappers Double and Integer?

a) Long

b) Digits

c) Float

d) Number

 

Q4. Which of these is wrapper for simple data type float?

a) float

b) double

c) Float

d) Double

 

Q5. Which of these methods is used to check for infinitely large and small values?

a) isInfinite()

b) isNaN()

c) Isinfinite()

d) IsNaN()

 

Q6. Which of these operators can be used to concatenate two or more String objects?

a) +

b) +=

c) &

d) || 

 

Q7. Which of these method of class String is used to obtain length of String object?

a) get()

b) Sizeof()

c) lengthof()

d) length()

 

Q8. Which of the following would compile without error?

a) int a = Math.abs(-5);

b) int b = Math.abs(5.0);

c) int c = Math.abs(5.5F);

d) int d = Math.abs(5L);

 

Q9. Which of the following are valid calls to Math.max?

1.Math.max(1,4)

2.Math.max(2.3,5)

3.Math.max(1,3,5,7)

4.Math.max(-1.5,-2.8f)

a) 1, 2 and 4

b) 2, 3 and 4

c) 1, 2 and 3

d) 3 and 4

 

Q10. What is the value of “d” after this line of code has been executed?

double d = Math.round ( 2.5 + Math.random() );

a) 2

b) 3

c) 4

d) 2.5

 

Q11. Which of the following would compile without error?

a) int a=Math.abs(-5);

b) int b=Math.abs(5.0);

c) int c=Math.abs(5.5F);

d) int d=Math.abs(5L);

 

Q12. Which of these is wrapper for simple data type float?

a) float

b) double

c) Float

d) Double 

 

Q13. Which of the following is method of wrapper Float for converting the value of an object into byte?

a) bytevalue()

b) byte bytevalue()

c) Bytevalue()

d) Byte Bytevalue()

 

Q14. Which of these methods is used to check for infinitely large and small values?

a) isInfinite()

b) isNaN()

c) Isinfinite()

d) IsNaN()

 

Q15. Which of the following package stores all the simple data types in java?

a) lang

b) java

c) util

d) java.packages

 

Q16. Which of these method of Object class can generate duplicate copy of the object on which it is called?

a) clone()

b) copy()

c) dublicate()

d) dito()

 

Q17. What is the value of double constant ‘E’ defined in Math class?

a) approximately 3

b) approximately 3.14

c) approximately 2.72

d) approximately 0

 

Q18. Which of these method is a rounding function of Math class?

a) max()

b) min()

c) abs()

d) All of the mentioned 

 

Q19. Which of these class contains only floating point functions?

a) Math

b) Process

c) System

d) Object

 

Q20. Which of these class encapsulate the run time state of an object or an interface?

a) Class

b) Object

c) Runtime

d) System 

 

Part 20: List for questions and answers of JAVA

 

Q1. Answer: c

 

Q2. Answer: a

 

Q3. Answer: d

 

Q4. Answer: c

 

Q5. Answer: c

 

Q6. Answer: a

 

Q7. Answer: d

 

Q8. Answer: a

 

Q9. Answer: a

 

Q10. Answer: b

 

Q11. Answer: a

 

Q12. Answer:

 

Q13. Answer: b

 

Q14. Answer: a

 

Q15. Answer: a

 

Q16. Answer: a

 

Q17. Answer: c

 

Q18. Answer: d

 

Q19. Answer: a


Q20. Answer: a