Search Header Logo

Java Methods Quiz

Authored by Thanh Le

Computers

Professional Development

Used 1+ times

Java Methods Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are Java methods called in C and C++?

Functions

Procedures

Classes

Variables

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the return type of a method that does not return anything in Java?

int

double

void

String

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using methods in Java?

To increase the file size

To perform operations

To create redundancy

To confuse the code

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, what is the keyword used to return a value from a method?

return

back

exit

finish

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the access modifier for a method that can be accessed from anywhere in the program in Java?

static

protected

private

public

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the name of the method in Java that adds two numbers?

addTwoNumbers

sum

calculate

addition

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the parameter type for the 'age' in the method 'minor or adult' in Java?

int

double

String

boolean

Access all questions and much more by creating a free account

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?