Java syntax

Java syntax

University

86 Qs

quiz-placeholder

Similar activities

Examen Informática para las Mates I ULPGC

Examen Informática para las Mates I ULPGC

University

90 Qs

Comp 2522 MT Review BBY Part 1

Comp 2522 MT Review BBY Part 1

University

91 Qs

Mobile Computing (Lecture 1)

Mobile Computing (Lecture 1)

University

84 Qs

Икт 2рк 1 ответ

Икт 2рк 1 ответ

University

81 Qs

Инфо Теория 14бет-27 бет

Инфо Теория 14бет-27 бет

University

86 Qs

DCN Prelims Reviewer

DCN Prelims Reviewer

University

85 Qs

ICT 198-289

ICT 198-289

University

90 Qs

Time and Space Complexity

Time and Space Complexity

University

91 Qs

Java syntax

Java syntax

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Prof Yetty

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

86 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the correct file extension for a Java program?

.java
.js
.py
.txt

Answer explanation

Java files are saved with a .java extension.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which keyword is used to declare a variable?

variable
var
int
let

Answer explanation

In Java, 'int' is used for integer variables.

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does the 'public' keyword signify in Java?

It is private
It is global
It is accessible to all
It is immutable

Answer explanation

public' allows access from any class in the program.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do you print text to the console in Java?

console.log()
echo()
System.out.println()
PrintText()

Answer explanation

System.out.println() is the correct way to print to the console in Java.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What happens if a local int variable is used without initialization?

It is initialized to 0
It is assigned a default value of 1
It results in compilation error
it is assigned a default value of null

Answer explanation

"Local variables in Java must be explicitly initialized before use, as they do not have default values. Attempting to use an uninitialized local variable results in a compilation error.

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What symbol is used to end a Java statement?

.
;
:
#

Answer explanation

Java statements end with a semicolon (;).

7.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

Which of the following are valid Java data types?

int
float
string
boolean
array

Answer explanation

Java supports int, float, and boolean as valid data types.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?