CMSC 131 EXAM 3 QUESTIONS WITH VERIFIED
ANSWERS
Abstraction - Answers - allows you to focus on what code does and not how
Procedural abstraction - Answers - specify what actions should be performed
Data Abstraction - Answers - Specify data objects for problem
Abstract Data Types - Answers - has values and operations Ex: Stack and Queue
Encapsulation - Answers - A design technique that calls for hiding implementation
details while providing an interface (methods in Java) for data access
ex: creating private functions
ArrayLists: advantages, disadvantages - Answers - Advantage: advantages of an array,
plus does not run out of space
Disadvantage: inserting can be slower than an array, can only hold objects
Array information - Answers - Arrays can have all data types primitive and object
must have a defined size
what are unimplemented methods called in a java interface? - Answers - abstract
methods
the signature of a method - Answers - name and parameter list
the parameter of a method - Answers - the variables that the method needs
comparing doubles - Answers - Double.compare( x, y);
how to create an object that implements an interface - Answers - Interface a = new
Object();
Can StringBuffers use equals method? - Answers - No
System.out.println(3.9 - 3.8 == .10); - Answers - false is possible as some numbers
cannot be represented precisely in binary
Model View Controller - Answers - Model contains the pure application data
View presents the model's data to the user
Controller exists between the view and the model
ANSWERS
Abstraction - Answers - allows you to focus on what code does and not how
Procedural abstraction - Answers - specify what actions should be performed
Data Abstraction - Answers - Specify data objects for problem
Abstract Data Types - Answers - has values and operations Ex: Stack and Queue
Encapsulation - Answers - A design technique that calls for hiding implementation
details while providing an interface (methods in Java) for data access
ex: creating private functions
ArrayLists: advantages, disadvantages - Answers - Advantage: advantages of an array,
plus does not run out of space
Disadvantage: inserting can be slower than an array, can only hold objects
Array information - Answers - Arrays can have all data types primitive and object
must have a defined size
what are unimplemented methods called in a java interface? - Answers - abstract
methods
the signature of a method - Answers - name and parameter list
the parameter of a method - Answers - the variables that the method needs
comparing doubles - Answers - Double.compare( x, y);
how to create an object that implements an interface - Answers - Interface a = new
Object();
Can StringBuffers use equals method? - Answers - No
System.out.println(3.9 - 3.8 == .10); - Answers - false is possible as some numbers
cannot be represented precisely in binary
Model View Controller - Answers - Model contains the pure application data
View presents the model's data to the user
Controller exists between the view and the model