Java Programming midterm exam

Java Programming midterm exam

University

24 Qs

quiz-placeholder

Similar activities

Java Programming Quiz for swapna

Java Programming Quiz for swapna

University

20 Qs

TP-002

TP-002

University

25 Qs

Quanta

Quanta

University

20 Qs

Exception Handling Quiz

Exception Handling Quiz

University

25 Qs

Java Programming Challenge

Java Programming Challenge

University

20 Qs

FUNDAMENTALS REVIEW QUIZ

FUNDAMENTALS REVIEW QUIZ

University

25 Qs

Computer Awareness

Computer Awareness

University

20 Qs

Round 1

Round 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?