Java Programming Flashcard - unit 1b

Java Programming Flashcard - unit 1b

Assessment

Flashcard

Information Technology (IT)

9th Grade

Practice Problem

Medium

Created by

Wayground Content

Used 1+ times

FREE Resource

Student preview

quiz-placeholder

22 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following correctly declares a string variable in Java? Options: String name = "Alice"; string name = "Alice"; String name == "Alice"; String name: "Alice";

Back

String name = "Alice";

2.

FLASHCARD QUESTION

Front

What will the statement System.out.print("Java "); System.out.print("Programming"); output?

Back

JavaProgramming

3.

FLASHCARD QUESTION

Front

Where should the import java.util.Scanner; statement be placed in a Java program?

Back

At the beginning of the program before the class declaration

4.

FLASHCARD QUESTION

Front

If you create a Scanner object as follows,
Scanner sc = new Scanner(System.in);
How can you read an integer input?

Back

int num = sc.nextInt();

5.

FLASHCARD QUESTION

Front

What will the value of x be after the following statements?
int x = 5;
x = x + 3;

Back

8

6.

FLASHCARD QUESTION

Front

What is the value of y after the following statements?
int y = 4;
y *= 2;

Back

8

7.

FLASHCARD QUESTION

Front

What will the following code output?
String text = "Hello, Java!";
int index = text.indexOf("Java");
System.out.println(index);

Back

7

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?