+923132835245
safcodeinstitute@gmail.com
Online Quiz
10000+ Questions!
Students Works
Ideas & Topics!
Live Coding
HTML & CSS
Home
(current)
About
Courses
CIT
Web Designing
Graphic Designing
Web Development
Digital Marketing
WordPress + SEO
Artificial Intelligence (AI)
Shopify + WordPress Development
Tutorials
Feedback
Programming Notes
Softwares
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. Which of the following statement is true regarding local inner class.
Can implement anonymous interfaces
Cannot access private members of the enclosing class
None of these
Associated with an instance of the enclosing class
View Answer
2. Identify the shortest manner in which you can decorate a Java annotation
prefix #
suflix @
prefix @
suffix #
View Answer
3. Which of the following methods cannot have a body in Java?
native
final
local
static
View Answer
4. 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
5. Time-zone based date and time information of a ZonedDateTime object can be accessed using _______ method.
getValue()
instant()
normalized()
of()
View Answer
6. What are default methods also known as? a. Virtual extension methods b. Defender methods c. Extension methods
B and C
Only A
A and B
Only B
View Answer
7. Which of the following keywords are used to explicitly raise an exception from a method?
none of these
throw and throws
try-catch
try and finally
View Answer
8. Which of the following annotations is used as custom annotation at runtime?
@Retention
@Documented
reference
interface
View Answer
9. Which of the following informs the JavaDoc tool that custom annotations must be visible in the JavaDoc for classes that are using custom animations?
@Reference
@Documented
@Target
@inherited
View Answer
10. In Java 8, which of the following classes is used in place of TimeZone.getDefault() method?
Instant
Clock
System
Duration
View Answer