
IT Interview Exam Questions: JAVA 24 (IT Campus Placement)
Subject: JAVA 24
Part 24: List for questions and answers of JAVA
Q1. What is the return type of a method that does not returns any value?
a) int
b) float
c) void
d) double
Q2. What is the process of defining more than one method in a class differentiated by method signature?
a) Function overriding
b) Function overloading
c) Function doubling
d) None of the mentioned
Q3. Which of the following is a method having same name as that of it’s class?
a) finalize
b) delete
c) class
d) constructor
Q4. Which method can be defined only once in a program?
a) main method
b) finalize method
c) static method
d) private method
Q5. Which of these class is super class of every class in Java?
a) String class
b) Object class
c) Abstract class
d) ArrayList class
Q6. Which of these method of Object class can clone an object?
a) Objectcopy()
b) copy()
c) Object clone()
d) clone()
Q7. Which of these method of Object class is used to obtain class of an object at run time?
a) get()
b) void getclass()
c) Class getclass()
d) None of the mentioned
Q8. Which of these keywords can be used to prevent inheritance of a class?
a) super
b) constant
c) Class
d) final
Q9. Which of these keywords cannot be used for a class which has been declared final?
a) abstract
b) extends
c) abstract and extends
d) None of the mentioned
Q10. Which of these class relies upon its subclasses for complete implementation of its methods?
a) Object class
b) abstract class
c) ArrayList class
d) None of the mentioned
Q11. What is the output of this program?
class Output {public static void main(String args[])
{ Object obj = new Object(); } }
a) Object
b) class Object
c) class java.lang.Object
d) Compilation Error
Q12. Which interface provides the capability to store objects using a key-value pair?
a) Java.util.Map
b) Java.util.Set
c) Java.util.List
d) Java.util.Collection
Q13. Which of these method of String class is used to obtain character at specified index?
a) char()
b) Charat()
c) charat()
d) charAt()
Q14. Which of these keywords is used to refer to member of base class from a sub class?
a) upper
b) super
c) this
d) None of the mentioned
Q15. Which of these method of String class can be used to test to strings for equality?
a) isequal()
b) isequals()
c) equal()
d) equals()
Q16. What is the stored in the object obj in following lines of code?box obj;
a) Memory address of allocated memory of object
b) NULL
c) Any arbitrary pointer
d) Garbage
Q17. Which of these keywords is used to make a class?
a) class
b) struct
c) int
d) None of the mentioned
Q18. Which of the following is a valid declaration of an object of class Box?
a) Box obj=new Box();
b) Box obj=new Box;
c) obj=new Box();
d) new Box obj;
Q19. Which of these operators is used to allocate memory for an object?
a) malloc
b) alloc
c) new
d) give
Q20. Which of these statement is incorrect?
a) Every class must contain a main() method
b) Applets do not require a main() method at all
c) There can be only one main() method in a program
d) main() method must be made public
Part 24: List for questions and answers of JAVA
Q1. Answer: c
Q2. Answer: b
Q3. Answer: d
Q4. Answer: a
Q5. Answer: b
Q6. Answer: c
Q7. Answer: c
Q8. Answer: d
Q9. Answer: a
Q10. Answer: b
Q11. Answer: c
Q12. Answer: a
Q13. Answer: d
Q14. Answer: b
Q15. Answer: d
Q16. Answer: b
Q17. Answer: a
Q18. Answer: a
Q19. Answer: c
Q20. Answer: