Sitevision Java quiz

Which data structure uses a Last-In-First-Out (LIFO) order?
Queue
Stack
Linked List
Array
Which of the following are valid access modifiers in Java?
Public
Private
Protected
Static
Final
What is the purpose of the `finally` block in a try-catch-finally statement?
It is executed if an exception is thrown
It is executed regardless of whether an exception is thrown or not
It is executed only if no exception is thrown
It is executed before the catch block
What is the Java Virtual Machine (JVM)?
A Java compiler
A part of the Java Development Kit (JDK)
A hardware device used for Java development
A runtime environment that executes Java bytecode
What does the static keyword mean when applied to a method or variable?
It makes the method or variable non-modifiable
It allows access to the method or variable without creating an instance of the class
It restricts access to the method or variable within the class
It allows multiple instances of the method or variable
Which of the following is not a valid Java primitive data type?
Int
Float
Boolean
String
What is the main purpose of a constructor in Java?
To initialize an object's instance variables
To define a new class
To declare a method
To perform mathematical calucaltions
{"name":"Sitevision Java quiz", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which data structure uses a Last-In-First-Out (LIFO) order?, Which of the following are valid access modifiers in Java?, What is the purpose of the `finally` block in a try-catch-finally statement?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker