Java Basics 2

Java Basics 2

9th Grade - University

15 Qs

quiz-placeholder

Similar activities

Arrays Unit 6 Computer Science

Arrays Unit 6 Computer Science

10th - 12th Grade

14 Qs

AP CSA Java Arrays

AP CSA Java Arrays

10th - 12th Grade

14 Qs

Data Types Java Concepts

Data Types Java Concepts

University

19 Qs

C# Cơ bản

C# Cơ bản

University

15 Qs

Topic 4.1 Introduction to Java

Topic 4.1 Introduction to Java

12th Grade

20 Qs

Java Bootcamp Day 4

Java Bootcamp Day 4

University

15 Qs

Arrays Unit 6 AP CSA

Arrays Unit 6 AP CSA

10th - 12th Grade

14 Qs

Codehs Unit 6

Codehs Unit 6

10th - 12th Grade

14 Qs

Java Basics 2

Java Basics 2

Assessment

Quiz

Computers

9th Grade - University

Hard

Created by

Tim Jones

Used 5+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the following method declaration, what is the name of the method?

public static void showMenu(String category) {}

public

static

void

showMenu

String

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the following method declaration header, how many formal parameters are there?

public static double squareRoot(double value)

0

1

2

None. Methods do not have formal parameters

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What word is missing below (fill in the __________). The method called increaseTemperature takes 2 integers as formal parameters. The two parameters represent the upper and lower targets. The method returns the difference between the upper and lower targets as an integer.

public static _________ increaseTemperature(int upper, int lower) { return upper - lower;}

void

double

int

return

Nothing. No word is needed in the blank space.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this main() method?


public static void main(String [] args) {

System.out.print("A");

processRequest();

System.out.print("B"); System.out.print("C");

showMenu();

System.out.print("D");}


public static void showMenu() { System.out.print("Q");}

public static void eraseFile() { System.out.print("T");}

public static void processRequest() { System.out.print("2");}

ABCDQT2

A2BDCTQ

A2BCQD

A2CBQD

A2BCQTD

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The following code in the main is valid:

public static void main(String [] args) {

int value; value = createGameCharacter();

// rest of program}

public static void createGameCharacter() { // code}

true

false

Impossible to determine

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The following code in the main is valid:

public static void main(String [] args) {

int value; value = depositMoney(amount); // rest of program}

public static int depositMoney() { return 4;}

true

false

Impossible to determine

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this main() method?

public static void main(String [] args) {

int value; loadSong(5);

value =checkLength(1);

System.out.print(value);

public static void loadSong(int id) { System.out.print(id);}

public static int checkLength(int id) { System.out.print(id); id = id + 4; System.out.print(id); return 9;}

5199

5559

5159

519

5

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?