JAVA 10

COEP
Lets Crack Online Exam

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

Subject: JAVA 10

Part 10: List for questions and answers of JAVA

 

Q1. Which of these keywords is used to define interfaces in Java?

a) interface

b) Interface

c) intf

d) Intf

 

Q2. Which of these can be used to fully abstract a class from its implementation?

a) Objects

b) Packages

c) Interfaces

d) None of the Mentioned

 

Q3. Which of these access specifiers can be used for an interface?

a) Public

b) Protected

c) private

d) All of the mentioned

 

Q4. Which of the following is correct way of implementing an interface salary by class manager?

a) class manager extends salary {}

b) class manager implements salary {}

c) class manager imports salary {}

d) None of the mentioned

 

Q5. Which of the following is incorrect statement about packages?

a) Interfaces specifies what class must do but not how it does

b) Interfaces are specified public if they are to be accessed by any code in the program

c) All variables in interface are implicitly final and static

d) All variables are static and methods are public if interface is defined pubic

 

Q6. Which of the following package stores all the standard java classes?

a) lang

b) java

c) util

d) java.packages 

 

Q7. Interfaces helps in which type of inheritance?

a) Multiple inheritance

b) Multilevel inheritance

c) Hierarchical inheritance

d) None of above

 

Q8. Thread class is available in?

a) java.io package

b) java.lang package

c) java.awt package

d) java.util package

 

Q9. Which of these interface declares core method that all collections will have?

a) set

b) EventListner

c) Comparator

d) Collection

 

Q10. Which of these interface handle sequences?

a) Set

b) List

c) Comparator

d) Collection

 

Q11. Which of these is Basic interface that all other interface inherits?

a) Set

b) Array

c) List

d) Collection

 

Q12. Which of these interface must contain a unique element?

a) Set

b) List

c) Array

d) Collection

 

Q13. Which of these interface is not a part of Java’s collection framework?

a) List

b) Set

c) SortedMap

d) SortedList 

 

Q14. Which collection class associates values witch keys, and orders the keys according to their natural order?

a) java.util.HashSet

b) java.util.LinkedList

c) java.util.TreeMap

d) java.util.SortedSet

 

Q15. Which of the given statement is not true about a Java Package?

a) A package can be defined as a group of similar types of classes and interface

b) Package are used in order to avoid name conflicts and to control access of classes and interface

c) A package cannot not have another package inside it

d) Java uses file system directory to store package

 

Q16. import keyword is used to?

a) both built-in packages and user-defined packages into your java source file

b) import only built-in packages into your java source file

c) import only user-defined packages into your java source file

d) None of the above

 

Q17. You can import only static members of a class present in some other package using __________?

a) import keyword

b) import static keyword

c) package keyword

d) static import keyword

 

Q18. Which of the statement is false about an abstract class?

a) An abstract class is a class that contains one or more abstract methods

b) An abstract class cannot have normal method

c) An abstract class cannot be instantiated

d) An abstract class can be extended

 

Q19. 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 start(short stop); 

 

Q20. Which of the following statement is true about an Interface?

a) Methods inside Interface can be static, final, native or strictfp

b) Interface can not extend one or more other interface

c) Interface cannot implement a class

d) Interface can not be nested inside another interface 

 

Part 10: List for questions and answers of JAVA

 

Q1. Answer: a

 

Q2. Answer: c

 

Q3. Answer: a

 

Q4. Answer: b

 

Q5. Answer: d

 

Q6. Answer: b

 

Q7. Answer: c

 

Q8. Answer: b

 

Q9. Answer: d

 

Q10. Answer: b

 

Q11. Answer: d

 

Q12. Answer: b

 

Q13. Answer: d

 

Q14. Answer: c

 

Q15. Answer: c

 

Q16. Answer: d

 

Q17. Answer: b

 

Q18. Answer: d

 

Q19. Answer: a

 

Q20. Answer: c