Java Basics & Keywords
Data Types & Variables:
Classes & Their Anatomy
Objects & Instantiation
Java Comments & Code Structure
100

What Java Keyword is used to create a new instance of a class?

What is "new"

100

What data type is used to store whole numbers like 50 and 90?

Int

100

The building block of object-oriented programming

Class

100

What is an object?

An instance of a class

100

which type of comment is used for single-line explanation?

Single-line comment

200

What is the keyword used to implement conditional branching in code?

What is "if, else, else if, and switch"

200

What data type is used to store decimal numbers like 5.75?

Double

200

A special method that is automatically called when an instance of the class is created

Constructor

200

What term is used for the blueprint or template for creating objects in Java?

A class

200

Which type of comment is used for multi-line explanations?

A multi-line comment

300

What is the difference between public and private in Java?

Public being least restrictive and Private being the most restrictive.

300

What data type is used to represent a single character?

Char

300

What does an instance variable inside a class do?

Stores the attributes of an object

300

What are the two components of an object ?

Attributes and Behavior

300
What is the term for the entry point?

Main method

400

What is the purpose of the "main" method in a Java program?

To serve as the entry point for the programs execution

400
What data type is used to represent true or false values?

Boolean

400

What keyword is used to create a new instance of a class?

New

400

Can you instantiate an abstract class?

No

400

What is the purpose of commenting code in Java?

Make code more readable, helps debugging, understand the code.

500

What is the difference between an Interface and an abstract class in Java?

Interface can only declare abstract methods and have no implementation, while abstract classes can have some concrete methods.

500

What data type is used to represent text ?

String

500
What keyword is used to define a class that cannot be instantiated and is typically used as a blueprint for other classes?

Abstract

500

What keyword is used to create a new instance of a class?

new

500

What is the purpose of return statement?

To specify the value that the method should return when called