Safcode | Code Your Ideas by Sir Safder
Ideas & Topics!
HTML & CSS
Amazon Virtual Assistant
Test Your Programming Skills with Safcode!
Here is all important interview / exams questions.
Student doing practice apptitude test on safcode platform.
Instruction: "Total Number of Questions: 20
Each question carry 10 mark , no negative marking"
1. Identify the shortest manner in which you can decorate a Java annotation
2. Which one is true about a constructor ?
A constructor is used to create objects.
A constructor may be declared private
All of the above
A constructor must have the same name as the class it is declared within.
3. Which of the following informs the JavaDoc tool that custom annotations must be visible in the JavaDoc for classes that are using custom animations?
4. Which of the following keywords are used to explicitly raise an exception from a method?
throw and throws
none of these
try and finally
5. What is the full form of JVM ?
None of them
Java Verified Machine
ava Very Large Machine
Java Virtual Machine
6. Which of the following are not Java keywords?
7. Which of the following methods cannot have a body in Java?
8. Which of the following statement is true regarding local inner class.
None of these
Cannot access private members of the enclosing class
Can implement anonymous interfaces
Associated with an instance of the enclosing class
9. Identify the number of times the @Repeatable annotation type can be executed on the same source code element by default.
10. Which of the following annotations is used as custom annotation at runtime?
11. Who is known as father of Java Programming Language?
12. Which of the following statement is true regarding a constructor in a class.
A constructor has an associated destructor
A constructer can be overloaded
A constructor returns void
All of them
13. What are default methods also known as? a. Virtual extension methods b. Defender methods c. Extension methods
A and B
B and C
14. The _____ class is declared without a name within a code block such as the body of a method.
None of these
Local inner class
15. Time-zone based date and time information of a ZonedDateTime object can be accessed using _______ method.
16. In Java code, the line that begins with /* and ends with */ is known as?
Single line comment
None of the above
Both A & B
17. A lambda expression facilitates __________
18. Which of the following functions on any Zoneld ensures that a fixed offset ID will be formed as a ZoneOffset?
19. Which of the following area in the memory stores object references, method parameters, and its local variables?
20. In Java 8, which of the following classes is used in place of TimeZone.getDefault() method?