
AP Computer Science A Unit 1 Quiz
Authored by Sheryl Edwards
Computers
9th - 12th Grade
Used 299+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
public class MyStars {
public static void main(String[] args) {
twice();
many();
}
public static void printStar() {
System.out.println(" * ");
}
public static void twice() {
printStar();
printStar();
}
public static void many() {
twice();
printStar();
twice();
}
}
2
4
5
7
9
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following Java statement
System.out.println(“ * “)
Which of the following is true about this Java statement?
(A)The statement contains a String literal that is missing a quotation mark " at its end
(B) The statement is missing a semicolon
(C) The statement uses incorrect capitalization (uppercase / lowercase)
(D) The statement uses braces [ ] instead of parentheses ( )
(E) There are no errors in this statement
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following Java statement.
System.out.println(“This test is fun!);
Which of the following is true about this Java statement?
(A)The statement contains a String literal that is missing a quotation mark " at its end
(
B) The statement is missing a semicolon
(C) The statement uses incorrect capitalization (uppercase / lowercase)
(D) The statement uses braces [ ] instead of parentheses ( ) .
(E) There are no errors in this statement
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following Java statement.
system.out.println(“How many more problems are there?”);
Which of the following is true about this Java statement?
The statement contains a String literal that is missing a quotation mark " at its end
The statement is missing a semicolon
The statement uses incorrect capitalization (uppercase / lowercase)
The statement uses braces [ ] instead of parentheses ( )
There are no errors in this statement
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following incorrect Java Program
class public HelpMe
Public Static Void main(String[] args){
System.out.println(“Oh no!”);
}
}
Which of the following is true about this program?
I.The class header is not correct Java syntax
II.The main method header is not correct Java syntax
III.The statement inside the main method body is not correct Java syntax
I only
II only
III only
I and II
I, II and III
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?