Docsity

CS 1706 Fall 2006 Quiz/HW 1: Object-Oriented Programming Concepts - Prof. Noah D. Barnette, Quizzes of Computer Science

Toggle sidebar
bg1
CS 1706 Fall 2006 Quiz/HW 1
1.) An object is an instance of a class
2.) The three principles of object oriented programming are:
a. Encapsulation
b. Polymorphism
c. Inheritance
3.) A class can interpret more then one interface: True
4.) The Common primitive types are: boolean, char, double, int
5.) For
public class A
{
private int x;
}
which of the following is a valid mutator method for x that can be called
outside of class A and performs the correct operation?
public void setX(int x1) {x = x1;}
6.) In Java, if not initialized in a constructor, a field will have an unknown
value when an object is created. FALSE
7.) The design approach that promotes making all design decisions up front
is called: Top Down
8.) A(n) Data Structure is a way of organizing information in a computer.
9.) Which statement is false?
a. Static methods cannot use this.
b. Static methods can be invoked on a class (as opposed to an instance
of a class).
c. Nonstatic methods are also called instance methods.
d. Nonstatic methods can be invoked on a class (as opposed to an
instance of a class).
e. Static methods are also called class methods.
10.) A(n) algorithm is a step-by-step process for doing something.

Partial preview of the text

Download CS 1706 Fall 2006 Quiz/HW 1: Object-Oriented Programming Concepts - Prof. Noah D. Barnette and more Quizzes Computer Science in PDF only on Docsity!

CS 1706 Fall 2006 Quiz/HW 1

1.) An object is an instance of a class 2.) The three principles of object oriented programming are: a. Encapsulation b. Polymorphism c. Inheritance 3.) A class can interpret more then one interface: True 4.) The Common primitive types are: boolean, char, double, int 5.) For public class A { private int x; } which of the following is a valid mutator method for x that can be called outside of class A and performs the correct operation? public void setX(int x1) {x = x1;} 6.) In Java, if not initialized in a constructor, a field will have an unknown value when an object is created. FALSE 7.) The design approach that promotes making all design decisions up front is called: Top Down 8.) A(n) Data Structure is a way of organizing information in a computer. 9.) Which statement is false? a. Static methods cannot use this. b. Static methods can be invoked on a class (as opposed to an instance of a class). c. Nonstatic methods are also called instance methods. d. Nonstatic methods can be invoked on a class (as opposed to an instance of a class). e. Static methods are also called class methods. 10.) A(n) algorithm is a step-by-step process for doing something.