Java Basics Quiz for CH/PT Students

Java Basics Quiz for CH/PT Students

University

16 Qs

quiz-placeholder

Similar activities

Quiz-Java

Quiz-Java

University

14 Qs

Saberes JAVA 2025-1

Saberes JAVA 2025-1

University

18 Qs

PSC - Vetores

PSC - Vetores

University

15 Qs

Java Quiz I

Java Quiz I

University

17 Qs

Aula07 - Matrizes

Aula07 - Matrizes

University

12 Qs

2F-3 | Python Quiz | 14/11/2024

2F-3 | Python Quiz | 14/11/2024

University

20 Qs

PPL (QUIZ 6) Memory Management Quiz

PPL (QUIZ 6) Memory Management Quiz

University

20 Qs

Викторина по Java программированию

Викторина по Java программированию

University

20 Qs

Java Basics Quiz for CH/PT Students

Java Basics Quiz for CH/PT Students

Assessment

Quiz

Information Technology (IT)

University

Medium

Created by

Geshani ITUM

Used 23+ times

FREE Resource

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

What does System.out.println() do?

Takes user input

Outputs text to the console

Ends a program

None of the above

2.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which keyword is used to define a class in Java?

class

define

struct

object

3.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

What is the purpose of the public keyword in Java?

It hides the method or class from other classes.

It allows the method or class to be accessed from outside.

It specifies that the method is private.

None of the above.

4.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which of the following is a correct way to declare a variable in Java?

int 1x = 10;

int x = 10;

integer x = 10;

num x = 10;

5.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

Which data type is used to store a single character in Java?

char

String

int

boolean

6.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

What will be the value of the variable z after executing the code below? int x = 5, y = 10; int z = x + y;

5

10

15

50

7.

MULTIPLE CHOICE QUESTION

20 sec • 5 pts

What will be the result of the following code? int a = 10, b = 3; System.out.println(a % b);

1

3

10

0

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?