You are on page 1of 6

9/22/22, 4:30 AM Self-Quiz Unit 4: Attempt review

Dashboard / My courses / CS 4405-01 - AY2023-T1 / 22 September - 28 September / Self-Quiz Unit 4

Started on Thursday, 22 September 2022, 4:23 AM


State Finished
Completed on Thursday, 22 September 2022, 4:30 AM
Time taken 6 mins 37 secs
Grade 10.00 out of 10.00 (100%)

Question 1

Correct

Mark 1.00 out of 1.00

What type of programming does Java implement?

Select one:
a. object oriented 

b. procedural

c. no-SQL

d. relational

Question 2

Correct

Mark 1.00 out of 1.00

What is a basic unit of a Java program or an object?

Select one:
a. method

b. class 

c. property

d. public

https://my.uopeople.edu/mod/quiz/review.php?attempt=8652269&cmid=310217 1/6
9/22/22, 4:30 AM Self-Quiz Unit 4: Attempt review

Question 3

Correct

Mark 1.00 out of 1.00

If a method does not return any value, what type would it take?

Select one:
a. Integer

b. String

c. void 

d. Intents

Question 4

Correct

Mark 1.00 out of 1.00

Java expects the start of the program to be in which method?

Select one:
a. private Main {}

b. private my Start(String[] args)

c. public void start()

d. public static void main(String[] args) 

https://my.uopeople.edu/mod/quiz/review.php?attempt=8652269&cmid=310217 2/6
9/22/22, 4:30 AM Self-Quiz Unit 4: Attempt review

Question 5

Correct

Mark 1.00 out of 1.00

Which method shows words on a screen?

Select one:
a. System.out.println(); 

b. printnow();

c. screen();

d. GPS();

Question 6

Correct

Mark 1.00 out of 1.00

The primitive types in Java are byte, short, int, long, float, double, char, boolean. Which one can be used to represent a word like
“Hello”?

Select one:
a. char

b. none, the String object should be used 

c. double

d. long

https://my.uopeople.edu/mod/quiz/review.php?attempt=8652269&cmid=310217 3/6
9/22/22, 4:30 AM Self-Quiz Unit 4: Attempt review

Question 7

Correct

Mark 1.00 out of 1.00

To create an integer variable and assign a value, you would use:

Select one:
a. Int myNumber = 5;

b. myNumber = 5;

c. int myNumber; myNumber = 5; 

d. 5 = myNumber;

Question 8

Correct

Mark 1.00 out of 1.00

To assign a value, Java uses a single “=” sign, as in x=5. What symbol is used to compare variables or values in an if statement?

Select one:
a. .=

b. =.

c. ++

d. == 

https://my.uopeople.edu/mod/quiz/review.php?attempt=8652269&cmid=310217 4/6
9/22/22, 4:30 AM Self-Quiz Unit 4: Attempt review

Question 9

Correct

Mark 1.00 out of 1.00

Consider the following Java code:

class Student {
private String firstName;
private String lastName;
public Student(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
// Your code goes here
}

public class Main {


public static void main(String[] args) {
Student[] students = new Student[] {
new Student("Morgan", "Freeman"),
new Student("Brad", "Pitt"),
new Student("Kevin", "Spacey"),
};
for (Student s : students) {
s.printFullName();
}
}
}

What do we call printFullName() ?

Select one:
a. function

b. static

c. display feature

d. method 

https://my.uopeople.edu/mod/quiz/review.php?attempt=8652269&cmid=310217 5/6
9/22/22, 4:30 AM Self-Quiz Unit 4: Attempt review

Question 10

Correct

Mark 1.00 out of 1.00

When using the keyword private before a variable or a method, it means only the class itself can access the variable or method. What
designation would allow access to the variable or the method from any part of the Java program?

Select one:
a. void

b. Integer

c. everyone

d. public 

◄ Learning Journal Unit 4

Jump to...

https://my.uopeople.edu/mod/quiz/review.php?attempt=8652269&cmid=310217 6/6

You might also like