Java Programming midterm exam

Java Programming midterm exam

University

24 Qs

quiz-placeholder

Similar activities

latihan UAS

latihan UAS

University

25 Qs

ComputerProgramming2LongQuiz

ComputerProgramming2LongQuiz

University

20 Qs

AppWiz round 1

AppWiz round 1

University

20 Qs

Java Debugging Questions - H

Java Debugging Questions - H

University

20 Qs

Round 3

Round 3

University

20 Qs

NOCTI: Graphic Design-Understanding Computer Peripherals

NOCTI: Graphic Design-Understanding Computer Peripherals

11th Grade - University

20 Qs

PEBO

PEBO

University

24 Qs

Java Simple - 1

Java Simple - 1

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?