Quiz #3

Wednesday

With a piece of paper, write down your name and answers to the following questions.

  1. Making an instance of one class a field in another class is called:

    1. Nesting
    2. Class Fielding
    3. Aggregation
    4. Concatenation
  2. What enum method returns the position of an enum constant in the declaration?

    1. position
    2. toString
    3. location
    4. ordinal
  3. What is the name of the process, performed periodically by the JVM, that automatically removes unreferenced objects from memory?

    1. Memory Cleansing
    2. Memory Deallocation
    3. Garbage Collection
    4. Object Expungement
  4. Is it necessary to override the toString method of an enum class in order to obtain a string representation of the name of an enum constant?

    Answer: No, it is not necessary.

  5. What is the output of the following program?

    public class Program {
    	public static void main(String[] args) {
    		MysteriousClass obj = new MysteriousClass();
    		obj.mysteriousPrint("def");
    	}
    }
    
    class MysteriousClass {
    	private String arg = "abc";
    
    	public void mysteriousPrint(String arg) {
    		System.out.println(arg);
    		System.out.println(this.arg);
    	}
    }

    Answer:

    def
    abc

Student Performance and Statistics

A histogram of student performance on percentage grades for Quiz 3 on Wednesday.

100% 2 90 - 99% 0 80 - 89% 6 70 - 79% 0 60 - 69% 6 50 - 59% 0 40 - 49% 3 30 - 39% 0 20 - 29% 1 10 - 19% 0 0 - 9% 0

A table showing the average performance for each question in Quiz 3 on Wednesday.

Q1 0.8 / 1 Q2 0.4 / 1 Q3 0.9 / 1 Q4 0.6 / 1 Q5 0.6 / 1