NEW
Font size
WorksheetsWeek 1
Total questions: 50
Worksheet time: 41mins
Choose the correct definition of Java
Java is an interpreted scripting language primarily used for styling web pages and adding interactivity to HTML documents.
Java is a compiled, functional programming language primarily used for complex database queries and data manipulation.
In Java, what does the acronym WORA stand for, and what does it mean in practice?
What is a high-level programming language?
A language that is very close to machine code (0s and 1s)
A language that focuses on hardware details and memory management
A language that uses syntax close to human language and hides complex hardware details
A language that can only run on one specific type of computer
In Java, what does it mean when we say Java is a class-based programming language?
All Java code must be written inside a class – a class serves as the blueprint for creating objects
Java only supports classes and does not allow objects
Java uses inheritance from multiple classes
Programs are made of standalone functions without classes
Which company originally developed Java, and in which year was it first publicly released?
Who is known as the “Father of Java”?
What was the original name of the Java programming language before it was renamed “Java”?
What is Java EE (Enterprise Edition) primarily used for?
What is Java ME (Micro Edition) primarily used for?
Developing applications for mobile and IoT devices
What is Java SE (Standard Edition) primarily used for?
Developing general-purpose applications, including desktop applications, console programs, and as the foundation for all other Java editions
Running Java on very small devices like old mobile phones
Building large enterprise web applications and servers
Creating Android mobile apps
What is JavaFX primarily used for in Java?
Which of the following statements is most accurate about learning Java (or programming in general)?
You need to learn advanced topics first before solving real problems
Complex problems can usually be solved by mastering and correctly applying the basic concepts
Only experienced programmers who know every Java library can solve difficult problems
Basics are only useful for simple programs, not real-world applications
What does JDK stand for and what is it used for in Java?
Java Development Kit – a software package that contains tools needed to develop, compile, and run Java programs
Java Design KitJava Deployment Kit – used only for installing Java on users’ computers
Java Development Kernel – the core part of the operating system for Java
Java Debugging Kit – only for finding errors in code
To write and run Java programs, you need the JDK. Why?
It only lets you run programs (like JRE)
It contains the compiler and tools to develop Java applications
It is only for advanced enterprise applications
It is the same as the Java Virtual Machine
What does JRE stand for and what is its purpose in Java?
Java Runtime Environment – provides the libraries and JVM to run Java programs
Java Resource Editor – used to edit Java source code
Java Runtime Engine – only compiles Java code
Java Repository Environment – stores Java libraries
What is the JVM in Java?
A tool used to write and edit Java source code
The Java Virtual Machine – it runs Java bytecode and makes Java platform-independent
A software package that contains the compiler (javac)
A library for building web applications
What is a variable in Java (or programming)?
A fixed value like 5 or "hello" that cannot change
A named storage location in memory that can hold a value and whose value can change during the program
A keyword used to create objects
A type of loop
How many types of variables are there in Java, and what are they?
2 types: global and local
3 types: local, instance, and static variables
4 types: int, float, char, and boolean
3 types: public, private, and protected
In Java, what does the syntax dataType variableName = value; represent?
A method declaration
A class definition
A variable declaration and initialization
A loop statement
Choose the correct variable declaration and initialization in Java:
int = number 10;
variable int number = 10;
int number = 10;
number int = 10;
A variable in Java must have a data type.
A variable name can start with a number.
Variable names can start with a letter, underscore, or dollar sign.
Variable names can contain spaces.
Variable names in Java are case-sensitive.
A variable must be initialized before it is used.
Variable names cannot contain special characters except _ and $.
Using camelCase for variable names is recommended in Java.
Which of the following examples correctly demonstrates the programming naming convention known as PascalCase?
is_authenticated_user
calculateTotalAmount
CustomerOrderDetails
database-connection-string
The programming term isEnrolled follows which of the following naming conventions?
camelCase
PascalCase
snake_case
kebab-case
What is the naming convention for the variable name user_account_id?
Identify the naming convention for the class name ProductDetailView.
Which naming convention is used for the file name about-us-page.html?
The method name processUserInput is an example of which convention?
Which naming convention is most commonly used for constants in languages like C++ and Java (e.g., MAX_ITERATIONS)?
Which of these variable names is written in PascalCase?
DatabaseConnection
validateAccount
is_data_ready
get_user_info
What is the primary difference between PascalCase and camelCase?
The URL slug /products/best-selling-items uses which naming convention?
A Boolean variable named hasPermissions is an example of which convention, and what does the prefix has suggest?
kebab-case; it suggests the variable stores a large object.
camelCase; it suggests the variable stores a true or false value.
PascalCase; it suggests the variable stores a number.
snake_case; it suggests the variable stores a string.
What is a data type in java
Data types are divided into two groups:
Primitive and reference data types
How many primitive types are there in Java?
What is the default data type when declaring a whole number in Java?
What is the default value of when you declare a whole number in Java?
What is the default data type when declaring a floating point number in Java?
What is the default value of when you declare a floating point number in Java?
What is the default value of when you declare a Boolean in Java?
A high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible.
Java
JavaScript
JavaRice
Java Coffee
What is the error in the following Java statement?
There is no error — all declarations are correct
Variable names cannot start with a number — 123count is invalid
The keyword int should be written as Integer
Which line has a syntax error when declaring or initializing a variable?
int age = 15
double height = 1.75;
boolean isStudent = true;
char grade = 'B';
