Safcode | Code Your Ideas by Sir Safder
+923132835245
safcodeinstitute@gmail.com
Online Quiz
10000+ Questions!
Students Works
Ideas & Topics!
Live Coding
HTML & CSS
Home
(current)
About
Courses
CIT
Web Designing
Office Automation
Graphics Designing
Web Development
Software Development
Digital Marketing
App Development
Amazon Virtual Assistant
YouTube Earning
WordPress Development
Tutorials
Feedback
Programming Notes
Contact
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"
Quiz Start
1. Identify the shortest manner in which you can decorate a Java annotation
suffix #
prefix @
suflix @
prefix #
View Answer
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.
View Answer
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?
@Target
@Reference
@inherited
@Documented
View Answer
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
try-catch
View Answer
5. What is the full form of JVM ?
None of them
Java Verified Machine
ava Very Large Machine
Java Virtual Machine
View Answer
6. Which of the following are not Java keywords?
switch
class
double
then
View Answer
7. Which of the following methods cannot have a body in Java?
native
local
static
final
View Answer
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
View Answer
9. Identify the number of times the @Repeatable annotation type can be executed on the same source code element by default.
Zero
Twice
One
Multiple
View Answer
10. Which of the following annotations is used as custom annotation at runtime?
interface
@Documented
@Retention
reference
View Answer
11. Who is known as father of Java Programming Language?
Blaise Pascal
Charles Babbage
Rasmus Lerdof
James Gosling
View Answer
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
View Answer
13. What are default methods also known as? a. Virtual extension methods b. Defender methods c. Extension methods
A and B
B and C
Only A
Only B
View Answer
14. The _____ class is declared without a name within a code block such as the body of a method.
None of these
Final Class
Anonymous class
Local inner class
View Answer
15. Time-zone based date and time information of a ZonedDateTime object can be accessed using _______ method.
of()
getValue()
instant()
normalized()
View Answer
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
Multiline comment
View Answer
17. A lambda expression facilitates __________
Logical programming
Functional programming
Structured programming
Backward reasoning
View Answer
18. Which of the following functions on any Zoneld ensures that a fixed offset ID will be formed as a ZoneOffset?
normalized()
now()
getVal()
of()
View Answer
19. Which of the following area in the memory stores object references, method parameters, and its local variables?
heap
Register
Accumulator
stack
View Answer
20. In Java 8, which of the following classes is used in place of TimeZone.getDefault() method?
System
Clock
Duration
Instant
View Answer