[go: up one dir, main page]

0% found this document useful (0 votes)
21 views8 pages

Fe JV 3 QS en

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

DEVELOPER JAVA FINAL TEST

Code: JAVA 03
Total question: 30
Allowed time: 30’

Note:
- Select one answer for each question.
- You are NOT allowed to used mobile or internet device during the exam.
Questions & answers
1. Which of the following is not an OOPS concept in Java??

A. Polymorphism
B. Inheritance
C. Compilation
D. Encapsulation

2. Which of these class is related to all the exceptions that can be caught by using catch?

A. Error
B. Exception
C. RuntimeExecption
D. All of the mentioned
3. What is the result?

A. 200.0 : 100.0
B. 400.0 : 200.0
C. 400.0 : 100.0
D. Compilation fails.

4. What is the numerical range of a char data type in Java?

Software Developer Final Test Page 1 of 8


A. 0 to 256
B. 0 to 65535
C. -128 to 127
D. 0 to 32767

5. Given the following piece of code?

A. The keywords public and abstract cannot be used together.


B. The method numberOfStudent() in class School must have a body.
C. You must add a return statement in method numberOfStudent().
D. Class School must be defined abstract.

6. Which of the following is a superclass of every class in Java?

A. ArrayList
B. Abstract class
C. Object class
D. String

7. What is true about constructor?

A. It can contain return type.


B. It can take any number of parameters.
C. It can have any non access modifiers
D. Constructor cannot throw an exception

8. Which of this access specifies can be used for a class so that its members can be accessed by
a different class in the same package?

A. Public
B. Protected
C. No Modifier
D. All of the mentioned

9. What is the result?

Software Developer Final Test Page 2 of 8


A. Sum is 600
B. Compilation fails at line n1.
C. Compilation fails at line n2.
D. A ClassCastException is thrown at line n1.

10. Which feature of OOPS described the reusability of code?

A. Abstraction.
B. Encapsulation.
C. Polymorphism
D. Inheritance

11. Which of these keywords are used for the block to be examined for exceptions?

A. check
B. throw
C. catch
D. try

12. What will be the output of the following Java program?

A. 2851
B. 1582
C. 2
D. 2185

13. Identify the keyword among the following that makes a variable belong to a class,rather
than being defined for each instance of the class?

A. final
B. static
C. abstract
D. public

Software Developer Final Test Page 3 of 8


14. What will be the output?

A. Compilation Error.
B. Class One method1.
C. Class Two method1.
D. Throws a NoSuchMethodException at runtime.

15. What will be the output?

And given the code fragment:

A. 4W 100 Auto4W 150 Manual.


B. Compilation fails only at line n1.
C. Compilation fails only at line n2.
D. Compilation fails at both line n1 and line n2.

16. Which of these is a super class of all exceptional type classes?

Software Developer Final Test Page 4 of 8


A. String
B. RuntimeExceptions
C. Throwable
D. Cacheable

17. What will be the output of the following Java program?

A. 22
B. 33
C. Runtime Error
D. Compilation Error

18. Which modification, made independently, enable the code to compile?

A. Make the method at line n1 public.


B. Make the method at line n2 public.
C. Make the method at line n3 protected.
D. Make the method at line n4 public.

19. What is the expected output?

Software Developer Final Test Page 5 of 8


A. Won't compile because of line (1); constructor can't be private.
B. Won't compile because of line (5); constructor can't be final
C. 50.
D. 10 50.

20. In Java, the size of the char data type is?

A. 1 bit
B. 7 bits
C. 1 byte
D. 2 bytes

21. Which code, inserted at the demanded place, allows the Sprite class to compile?

A. 0;
B. Compilation error, arrays cannot be initialized to zero size;
C. Compilation error, it is a.length() not a.length;
D. None of the above;

22. Which of the following is not a valid statement in JDBC??

A. Statement;
B. PreparedStatement;
C. QueryStatement;
D. CallableStatement;

23. What is the result of the following piece of code?

Software Developer Final Test Page 6 of 8


A. I am a Person.
B. I am a Student.
C. I am a Person I am a Student.
D. I am a Student I am a Person.

24. What is the output of the following code?

A. 0
B. 1
C. 2
D. 3

25. Which interface does not allow duplicates elements?

A. Set.
B. List.
C. Map.
D. All the answers are true.

26. What is the result?

Software Developer Final Test Page 7 of 8


A. Match 1
B. No Match
C. Match 2
D. A NullPointerException is thrown at runtime.

27. Which of these interfaces is not part of the collection framework in Java?

A. Collection
B. Set
C. Group.
D. List.

28. Which component is used to compile, debug and execute the java programs?

A. JRE.
B. JIT.
C. JDK.
D. JVM.

29. What is the difference between Queue and Stack?

A. Stack is LIFO; Queue is FIFO.


B. Queue is LIFO; Stack is FIFO.
C. Stack and Queue is FIFO.
D. Stack and Queue is LIFO.

30. Method overriding is combination of inheritance and polymorphism?

A. True.
B. false.

Software Developer Final Test Page 8 of 8

You might also like