CSE Final
True
A name defined in an outer scope is also available in all blocks nested inside that scope
True
A reference type variable can store a null reference in Java.
True
A sub-class has no access to private instance variables of its super class.
False
A subclass that inherits instance variables from its super class may not declare additional instance variables.
True
An "has a" relationship is implemented by composition.
instantiation
Creating an object of a class is called _____.
Object is destroyed
Immediately after the objects variables are initiated the
methods
In Java functions are called _____.
2
In Java, a two dimensional array requires _____ indexes to access a specific element.
True
In Java, arrays are reference types.
int
In Java, when you divide an int by another int, the result will be a(n) _____.
False
Members that are private in the super class are visible in the derived class.
void
The Java keyword used to declare that a method does not return a value is _____.
False
The equals method and the == operator perform the same actions.
Data hiding can allow us to separate the information from its representation.
True
True
We can use a variable as an index expression to access an array element in Java.
True
When there are no remaining references to an object in your Java program, the object will be destroyed.
new
Which keyword is used in Java to create an object?
Polymorphism
Which object oriented element best allows us to designing and implementing families of related types that share outward similarities, but have specialized behaviors?
Composition
Which object oriented element is used to define "has a" relationships?
blueprints and buildings *maybe
Which of the following are good analogies for classes and objects?
int double boolean float byte chart short long
Which of the following is a Java primitive data type? Choose all that apply.
an array is a set of variables the elements of an array all located contiguously in memory the elements of an array all have the same data type the elements of an array are accessed by an integer index
Which of the following is/are true about arrays? Choose all that apply.
int[] values = new int[6];
Which of the following would correctly declare and instantiate an array of 6 ints?
True
You can always use a sub-class object in place of a super class object.
False
You cannot have an object reference whose type is an abstract class.
new int[5]
which of the following would instantiate an array of 5 integers in Java? Choose all that apply.