Sample Quiz

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

  1. What is a function in terms of Computer Sciences?

    1. A group of code lines that performs a specific task
    2. A group of code lines that performs a whole program
    3. Something that contains an "init"
    4. The purpose of Java
  2. What will be the value of "num" after the following statements?

    int num;
    num = (5+4);
    num = num / 9;
    num = 12;
    1. 0
    2. 1
    3. 12
    4. 9
  3. What is a class?

    1. A class is a section of computer memory containing objects.
    2. A class is a section of the hard disk reserved for object oriented program.
    3. A class is a description of a kind of object.
    4. A class is the part of an object that contains the variables.
  4. Which of the following is a correct way to construct a String object?

    1. String str("Hello Quiz!");
    2. String = "Hello Quiz!";
    3. String str = new "Hello Quiz!";
    4. String str = new String("Hello Quiz!");
  5. What is an object?

    1. An object is a chunk of memory that can contain data along with methods to process data.
    2. An object is a tiny box of memory that contains only data.
    3. "Object" is another word for "program".
    4. An object is description of a potential class.