Java Programming Flashcard - unit 1b

Java Programming Flashcard - unit 1b

Assessment

Flashcard

Information Technology (IT)

9th Grade

Hard

Created by

Quizizz Content

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

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?