Quiz 5
Friday
With a piece of paper, write down your name and answers to the following questions.
If
personAandpersonBare objects of the same class,Person, to makepersonBa copy ofpersonA,- we can assign
personBtopersonA, i.e.,personB = personA. - we can use the default constructor to create
personBwithpersonAdata members. - we can write a copy constructor that accepts a
Personobject as an argument, and makes a field by field copy. - we can use the
copymethod provided by the Java framework.
- we can assign
What will be returned from a method if the following is the method definition in a UML diagram.
+ getPerson(name:String) : Person
- An object of the class
Person. - The address of an object of the class
Person. - The value stored in the data members of the
Personobject. - A
Stringrepresenting thenamevariable.
- An object of the class
What is the output of the following program
import java.util.ArrayList; public final class Program { public static void main(final String[] args) { int var1 = 10; String var2 = "Java"; modify(var1, var2); System.out.println("var1 = " + var1 + ", var2 = " + var2); } public static void modify(int var1, String var2) { var1 = 20; var2 = "Python"; } }var1 = 10, var2 = Javavar1 = 10, var2 = Pythonvar1 = 20, var2 = Javavar1 = 20, var2 = Python
What is the relationship created by object aggregation?
- Is a
- Sub-class object
- Has a
- Inner class
Student Performance and Statistics
A histogram of student performance on percentage grades for Quiz 5 on Friday.
A table showing the average performance for each question in Quiz 5 on Friday.