Java Quiz
Test YourSelf
What is the correct way to declare a
1 ️
1️⃣
variable in Java?
• A. int x = 10;
• B. var x = 10;
• C. x := 10;
• D. declare int x = 10;
Java is a:
2 ️
2️⃣
• A. Procedural Language
• B. Functional Language
• C. Object-Oriented Programming Language
• D. Scripting Language
Which method is the entry point of a Java
3️⃣
program?
• A. start()
• B. main()
• C. run()
• D. init()
What will be the result of
4 ️
4️⃣
System.out.println(5 + 3 + "Java");?
• A. 8Java
• B. 53Java
• C. Java53
• D. Java8
Which keyword is used to create a class?
5️⃣
• A. new
• B. void
• C. class
• D. public
What is the default value of an int in Java (class
6 ️
6️⃣
level)?
• A. 0
• B. Null
• C. Undefined
• D. Garbage Value
What is the output of:
7 ️
7️⃣
int x = 5;
System.out.println(x++);
• A. 5
• B. 6
• C. Compilation error
• D. Runtime error
Which of the following is not a valid access
8 ️
8️⃣
modifier in Java?
• A. public
• B. private
• C. protected
• D. internal
What is the use of the final keyword in
9️⃣
Java?
• A. To create an object
• B. To define a constant
• C. To create a class
• D. To import a package
🔟 Which of the following is a checked exception?
• A. NullPointerException
• B. ArithmeticException
• C. IOException
• D. ArrayIndexOutOfBoundsException
What does super keyword refer to in Java?
1 ️
1 ️
1️⃣
1️⃣
• A. Parent class
• B. Subclass
• C. Interface
• D. Abstract class
Can a class implement multiple interfaces in Java?
1 ️
2 ️
1️⃣
2️⃣
• A. Yes
• B. No
Which method is called before object is garbage collected?
1 ️
3 ️
1️⃣
3️⃣
• A. delete()
• B. finalize()
• C. destroy()
• D. dispose()
What does static keyword mean in Java?
1 ️
4 ️
1️⃣
4️⃣
• A. Belongs to instance
• B. Belongs to class
• C. Temporary variable
• D. None
What is the correct syntax of creating an ArrayList in Java?
1 ️
5 ️
1️⃣
5️⃣
• A. List list = new ArrayList();
• B. Array list = new ArrayList();
• C. ArrayList list = new list();
• D. new ArrayList = List();

More Related Content

PPTX
Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs
PDF
Java Programming.pdf
PPTX
ELIMINATION ROUND for ISAAL game plan.pptx
PDF
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
PPTX
PPT Lecture-1.2 java basics jvm, literals,
PPTX
DAY_1.1.pptx
PDF
Cracking OCA and OCP Java 8 Exams
PDF
Java MCQs.pdf
Master the Concepts Behind the Java 10 Challenges and Eliminate Stressful Bugs
Java Programming.pdf
ELIMINATION ROUND for ISAAL game plan.pptx
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
PPT Lecture-1.2 java basics jvm, literals,
DAY_1.1.pptx
Cracking OCA and OCP Java 8 Exams
Java MCQs.pdf

Similar to Java Quizfor beginners on Inheritan.pptx (20)

PDF
Java MCQ Questions and Answers PDF By ScholarHat
PDF
Getting Started with Java
PPTX
Mastering Java Bytecode - JAX.de 2012
PDF
Building High Performance Android Applications in Java and C++
PDF
ITI COPA Java MCQ important Questions and Answers
PPTX
Std 12 chapter 7 Java Basics Important MCQs
DOC
Java questions1
PPT
JAVA INTRODUCTION
PDF
Fast as C: How to Write Really Terrible Java
PPTX
introduction to c #
PDF
Building Atlassian Plugins with Groovy - Atlassian Summit 2010 - Lightning Talks
PDF
Selenium webdriver interview questions and answers
ODP
Let's talk about Certifications
PPTX
Java Fundamentals in Mule
PDF
C# programming constructors
PDF
Java Multiple Choice Questions and Answers
KEY
Frederick web meetup slides
PPTX
How to crack java script certification
PDF
Why Java Sucks and C# Rocks (Final)
DOC
MX Server is my friend
Java MCQ Questions and Answers PDF By ScholarHat
Getting Started with Java
Mastering Java Bytecode - JAX.de 2012
Building High Performance Android Applications in Java and C++
ITI COPA Java MCQ important Questions and Answers
Std 12 chapter 7 Java Basics Important MCQs
Java questions1
JAVA INTRODUCTION
Fast as C: How to Write Really Terrible Java
introduction to c #
Building Atlassian Plugins with Groovy - Atlassian Summit 2010 - Lightning Talks
Selenium webdriver interview questions and answers
Let's talk about Certifications
Java Fundamentals in Mule
C# programming constructors
Java Multiple Choice Questions and Answers
Frederick web meetup slides
How to crack java script certification
Why Java Sucks and C# Rocks (Final)
MX Server is my friend
Ad

Recently uploaded (20)

PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Configure Apache Mutual Authentication
PPTX
TEXTILE technology diploma scope and career opportunities
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPT
Module 1.ppt Iot fundamentals and Architecture
DOCX
Basics of Cloud Computing - Cloud Ecosystem
PPTX
The various Industrial Revolutions .pptx
PPTX
Modernising the Digital Integration Hub
PDF
Getting started with AI Agents and Multi-Agent Systems
PPT
Geologic Time for studying geology for geologist
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PDF
Five Habits of High-Impact Board Members
4 layer Arch & Reference Arch of IoT.pdf
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Configure Apache Mutual Authentication
TEXTILE technology diploma scope and career opportunities
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
A review of recent deep learning applications in wood surface defect identifi...
A contest of sentiment analysis: k-nearest neighbor versus neural network
Module 1.ppt Iot fundamentals and Architecture
Basics of Cloud Computing - Cloud Ecosystem
The various Industrial Revolutions .pptx
Modernising the Digital Integration Hub
Getting started with AI Agents and Multi-Agent Systems
Geologic Time for studying geology for geologist
Module 1 Introduction to Web Programming .pptx
NewMind AI Weekly Chronicles – August ’25 Week III
sustainability-14-14877-v2.pddhzftheheeeee
sbt 2.0: go big (Scala Days 2025 edition)
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Five Habits of High-Impact Board Members
Ad

Java Quizfor beginners on Inheritan.pptx

  • 2. What is the correct way to declare a 1 ️ 1️⃣ variable in Java? • A. int x = 10; • B. var x = 10; • C. x := 10; • D. declare int x = 10;
  • 3. Java is a: 2 ️ 2️⃣ • A. Procedural Language • B. Functional Language • C. Object-Oriented Programming Language • D. Scripting Language
  • 4. Which method is the entry point of a Java 3️⃣ program? • A. start() • B. main() • C. run() • D. init()
  • 5. What will be the result of 4 ️ 4️⃣ System.out.println(5 + 3 + "Java");? • A. 8Java • B. 53Java • C. Java53 • D. Java8
  • 6. Which keyword is used to create a class? 5️⃣ • A. new • B. void • C. class • D. public
  • 7. What is the default value of an int in Java (class 6 ️ 6️⃣ level)? • A. 0 • B. Null • C. Undefined • D. Garbage Value
  • 8. What is the output of: 7 ️ 7️⃣ int x = 5; System.out.println(x++); • A. 5 • B. 6 • C. Compilation error • D. Runtime error
  • 9. Which of the following is not a valid access 8 ️ 8️⃣ modifier in Java? • A. public • B. private • C. protected • D. internal
  • 10. What is the use of the final keyword in 9️⃣ Java? • A. To create an object • B. To define a constant • C. To create a class • D. To import a package
  • 11. 🔟 Which of the following is a checked exception? • A. NullPointerException • B. ArithmeticException • C. IOException • D. ArrayIndexOutOfBoundsException
  • 12. What does super keyword refer to in Java? 1 ️ 1 ️ 1️⃣ 1️⃣ • A. Parent class • B. Subclass • C. Interface • D. Abstract class
  • 13. Can a class implement multiple interfaces in Java? 1 ️ 2 ️ 1️⃣ 2️⃣ • A. Yes • B. No
  • 14. Which method is called before object is garbage collected? 1 ️ 3 ️ 1️⃣ 3️⃣ • A. delete() • B. finalize() • C. destroy() • D. dispose()
  • 15. What does static keyword mean in Java? 1 ️ 4 ️ 1️⃣ 4️⃣ • A. Belongs to instance • B. Belongs to class • C. Temporary variable • D. None
  • 16. What is the correct syntax of creating an ArrayList in Java? 1 ️ 5 ️ 1️⃣ 5️⃣ • A. List list = new ArrayList(); • B. Array list = new ArrayList(); • C. ArrayList list = new list(); • D. new ArrayList = List();