Java Programming midterm exam

Java Programming midterm exam

University

24 Qs

quiz-placeholder

Similar activities

BASICS OF JAVA-1

BASICS OF JAVA-1

University

20 Qs

Quizz 2

Quizz 2

University

20 Qs

Arduino

Arduino

University

25 Qs

COMPUTER HARDWARE

COMPUTER HARDWARE

12th Grade - University

20 Qs

Eclipse

Eclipse

KG - Professional Development

20 Qs

Moini Ch12 Computers

Moini Ch12 Computers

11th Grade - Professional Development

24 Qs

BIG DATA

BIG DATA

University

25 Qs

Fundamental of Information System

Fundamental of Information System

University

20 Qs

Java Programming midterm exam

Java Programming midterm exam

Assessment

Quiz

Other

University

Medium

Created by

Bryan Cajurao

Used 4+ times

FREE Resource

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

What defines a class in a Java program?

public static void main(String[] args)

public class HelloWorld

System.out.println()

import java.util.Scanner

2.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

What symbol is used to terminate a Java statement?

Colon (:)

Semicolon (;)

Comma (,)

Period (.)

3.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

What is the starting point of any Java program?

The first line of the file

The main method

The class declaration

The import statement

4.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

Which of the following is used to denote the beginning and end of a block in Java?

Parentheses ()

Square brackets []

Curly braces {}

Angle brackets <>

5.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

What is the purpose of the public keyword in a class declaration?

It makes the class accessible to other classes from other packages.

It restricts the class to the same package.

It prevents the class from being instantiated.

It makes the class immutable.

6.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

Which of the following is NOT a type of Java comment?

Single-line (//)

Multi-line (/* */)

Javadoc (/** */)

Inline (#)

7.

MULTIPLE CHOICE QUESTION

3 mins • 2 pts

What is the correct way to write a single-line comment in Java?

/* This is a comment */

// This is a comment

# This is a comment

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?