Package deal
CMSC132(Complete solutions)
cmsc 132 runtime stuff(Correctly solved) CMSC132 Midterm 1(Correct solutions) CMSC 132 - 3 Machine Models(A+ Guaranteed)
[Show more]cmsc 132 runtime stuff(Correctly solved) CMSC132 Midterm 1(Correct solutions) CMSC 132 - 3 Machine Models(A+ Guaranteed)
[Show more]Classes can only extend more than one other class if at least one of those classes is an abstract class. correct answers False - a Class can never extend more than one class. 
 
Downcasting can be done implicitly. correct answers False - it must be done explicitly or your code will not compile. 
 
...
Preview 2 out of 7 pages
Add to cartClasses can only extend more than one other class if at least one of those classes is an abstract class. correct answers False - a Class can never extend more than one class. 
 
Downcasting can be done implicitly. correct answers False - it must be done explicitly or your code will not compile. 
 
...
Abstraction provides correct answers high level model of activity 
 
Procedural abstraction correct answers Specifies actions performed 
hides algorithms 
 
Data abstraction correct answers Specifies data objects for the problem 
Hides implementations 
 
Encapsulation correct answers hides implement...
Preview 2 out of 7 pages
Add to cartAbstraction provides correct answers high level model of activity 
 
Procedural abstraction correct answers Specifies actions performed 
hides algorithms 
 
Data abstraction correct answers Specifies data objects for the problem 
Hides implementations 
 
Encapsulation correct answers hides implement...
What is the only time that data from your program exists? correct answers When the program is actually running 
 
All parameters in Java are passed by _________ correct answers Value 
 
When does a parameter come into existence? correct answers When the method is called 
 
When do types come into ex...
Preview 2 out of 9 pages
Add to cartWhat is the only time that data from your program exists? correct answers When the program is actually running 
 
All parameters in Java are passed by _________ correct answers Value 
 
When does a parameter come into existence? correct answers When the method is called 
 
When do types come into ex...
Subclasses correct answers - inherits all properties, behaviors, and fields of its superclass 
- inherits private fields and methods in its superclasses, but it cannot directly access them 
- can have more methods than its superclass 
- classes can only extend one superclass 
- subclass is a type of...
Preview 2 out of 8 pages
Add to cartSubclasses correct answers - inherits all properties, behaviors, and fields of its superclass 
- inherits private fields and methods in its superclasses, but it cannot directly access them 
- can have more methods than its superclass 
- classes can only extend one superclass 
- subclass is a type of...
What is the main reason software projects fail? correct answers Complexity of projects 
 
What is the program life-cycle? correct answers Problem Specification, Program Design, Algorithms and Data Structures, Coding and Debugging, Testing and Verification, Deployment, Documentation and Support, Main...
Preview 2 out of 5 pages
Add to cartWhat is the main reason software projects fail? correct answers Complexity of projects 
 
What is the program life-cycle? correct answers Problem Specification, Program Design, Algorithms and Data Structures, Coding and Debugging, Testing and Verification, Deployment, Documentation and Support, Main...
What do you find in a java interface? correct answers method prototypes, final static variables, static methods (note: instance methods are ok if you use the term 'default'). 
 
The classes that implement an interface must implement ___________ correct answers Instance methods from interface (note...
Preview 3 out of 23 pages
Add to cartWhat do you find in a java interface? correct answers method prototypes, final static variables, static methods (note: instance methods are ok if you use the term 'default'). 
 
The classes that implement an interface must implement ___________ correct answers Instance methods from interface (note...
Recursion correct answers A strategy for solving problems where a method calls itself 
Recursion relies on the runtime call stack 
 'every method invocation gets its own stack space 
 
Tail recursion correct answers -Single recursive call thats the last thing performed in the method 
 'can easily ...
Preview 1 out of 4 pages
Add to cartRecursion correct answers A strategy for solving problems where a method calls itself 
Recursion relies on the runtime call stack 
 'every method invocation gets its own stack space 
 
Tail recursion correct answers -Single recursive call thats the last thing performed in the method 
 'can easily ...
Provide an example that illustrates procedural abstraction correct answers One example: a function that sorts data, but we don't indicate how to sort it. 
 
the private access specifier correct answers Mention one Java language feature that allow us to implement encapsulation. 
 
Yes, as finalize()...
Preview 1 out of 2 pages
Add to cartProvide an example that illustrates procedural abstraction correct answers One example: a function that sorts data, but we don't indicate how to sort it. 
 
the private access specifier correct answers Mention one Java language feature that allow us to implement encapsulation. 
 
Yes, as finalize()...
Three data structures that can implement the List abstract data type (ADT) are _____________, ______________, and _____________. correct answers arrays, linked lists, doubly linked lists 
 
(T/F) Arrays are part of the actual Java language. correct answers TRUE. (They are not part of the library) 
 ...
Preview 2 out of 5 pages
Add to cartThree data structures that can implement the List abstract data type (ADT) are _____________, ______________, and _____________. correct answers arrays, linked lists, doubly linked lists 
 
(T/F) Arrays are part of the actual Java language. correct answers TRUE. (They are not part of the library) 
 ...
Abstraction correct answers Separates the interface from the algorithms 
 
Encapsulation correct answers Hides the algorithms and only provides the interface 
 
Abstract method correct answers All methods in an interface are abstract implicitly, unless "default" keyword 
 
In a non-interface, the ...
Preview 1 out of 2 pages
Add to cartAbstraction correct answers Separates the interface from the algorithms 
 
Encapsulation correct answers Hides the algorithms and only provides the interface 
 
Abstract method correct answers All methods in an interface are abstract implicitly, unless "default" keyword 
 
In a non-interface, the ...
What is an "instance" member? correct answers a member that belongs to an Instance of an object 
 
What is a "static" member? correct answers member that belongs to the class itself and does not require an instance of an object 
 
True/False: 
a. A class can implement numerous interfaces. 
b. ...
Preview 2 out of 8 pages
Add to cartWhat is an "instance" member? correct answers a member that belongs to an Instance of an object 
 
What is a "static" member? correct answers member that belongs to the class itself and does not require an instance of an object 
 
True/False: 
a. A class can implement numerous interfaces. 
b. ...
Multithreading Problems correct answers We want computer systems to be able to perform many tasks simultaneously 
 
How do we do this? 
Multiprocessing- Multiple processing units allow a system to actually work on several tasks in parallel 
Multitasking- OS managed 
 
Concurrent programming correct...
Preview 1 out of 4 pages
Add to cartMultithreading Problems correct answers We want computer systems to be able to perform many tasks simultaneously 
 
How do we do this? 
Multiprocessing- Multiple processing units allow a system to actually work on several tasks in parallel 
Multitasking- OS managed 
 
Concurrent programming correct...
When implementing a linked list class, the inner class representing the nodes serves as a __________ around a piece of _________ and a reference to another node. correct answers wrapper, data 
 
What does an empty linked list look like? correct answers head ---> null 
 
Use a for loop to traverse...
Preview 2 out of 10 pages
Add to cartWhen implementing a linked list class, the inner class representing the nodes serves as a __________ around a piece of _________ and a reference to another node. correct answers wrapper, data 
 
What does an empty linked list look like? correct answers head ---> null 
 
Use a for loop to traverse...
operands, results correct answers Where do o__ come from? Where do the r__ go? 
 
ALU, memory, processor correct answers 3 Machine Models: A__ M__ P__ 
 
stack, accumulator, general-purpose register correct answers 3 main types of instruction sets s__ a__ g__ 
 
organization of registers, access mem...
Preview 1 out of 1 pages
Add to cartoperands, results correct answers Where do o__ come from? Where do the r__ go? 
 
ALU, memory, processor correct answers 3 Machine Models: A__ M__ P__ 
 
stack, accumulator, general-purpose register correct answers 3 main types of instruction sets s__ a__ g__ 
 
organization of registers, access mem...
What is a class in Java? correct answers A class in Java is a blueprint for creating objects. It defines a data structure that includes variables and methods. Classes provide a means for bundling data and methods that operate on the data into one unit. 
 
How is an object created in Java? correct an...
Preview 2 out of 8 pages
Add to cartWhat is a class in Java? correct answers A class in Java is a blueprint for creating objects. It defines a data structure that includes variables and methods. Classes provide a means for bundling data and methods that operate on the data into one unit. 
 
How is an object created in Java? correct an...
object-oriented programming correct answers takes advantage of abstraction and encapsulation 
 
abstraction correct answers provides high level model of activity of data, what it does 
 
procedural abstraction correct answers specifies what actions should be performed, hide algorithms 
 
example: s...
Preview 2 out of 10 pages
Add to cartobject-oriented programming correct answers takes advantage of abstraction and encapsulation 
 
abstraction correct answers provides high level model of activity of data, what it does 
 
procedural abstraction correct answers specifies what actions should be performed, hide algorithms 
 
example: s...
Lets say there is a class called Student that extends a class called Person and we write: 
 
Student s = .....; 
Person p = (Person)s; 
 
Is this up casting or down casting? will it work? correct answers This is upcasting and it will work without any issues. 
 
Lets say there is a class called Stude...
Preview 2 out of 8 pages
Add to cartLets say there is a class called Student that extends a class called Person and we write: 
 
Student s = .....; 
Person p = (Person)s; 
 
Is this up casting or down casting? will it work? correct answers This is upcasting and it will work without any issues. 
 
Lets say there is a class called Stude...
abstraction correct answers a technique in which we provide a very high-level model of activity or data. Small details about the model's functionality are not specifies to the user. 
 
procedural abstraction correct answers in which the user is aware of what actions are being performed but they are...
Preview 1 out of 4 pages
Add to cartabstraction correct answers a technique in which we provide a very high-level model of activity or data. Small details about the model's functionality are not specifies to the user. 
 
procedural abstraction correct answers in which the user is aware of what actions are being performed but they are...
What does it mean for a class/object to be immutable? correct answers The state (instance variables) are set during construction but cannot be modified after that. 
 
What does it mean for a class/object to be mutable? correct answers The state is set during construction and it might be modified lat...
Preview 2 out of 8 pages
Add to cartWhat does it mean for a class/object to be immutable? correct answers The state (instance variables) are set during construction but cannot be modified after that. 
 
What does it mean for a class/object to be mutable? correct answers The state is set during construction and it might be modified lat...
What is the average runtime for adding an element to the end of a singly linked list with a tail reference? correct answers O(1) 
 
What is the worst-case runtime for removing an element from a singly linked list if you are given a cursor to the node containing that element? correct answers O(n) 
 
...
Preview 1 out of 1 pages
Add to cartWhat is the average runtime for adding an element to the end of a singly linked list with a tail reference? correct answers O(1) 
 
What is the worst-case runtime for removing an element from a singly linked list if you are given a cursor to the node containing that element? correct answers O(n) 
 
...
Private keyword correct answers Which term allows us to implement encapsulation in java? 
 
48% of the code has been tested. correct answers A set of Tests generate 48% code coverage. What does this mean? 
 
Methods correct answers When designing object-oriented systems what do verbs in a problem st...
Preview 1 out of 4 pages
Add to cartPrivate keyword correct answers Which term allows us to implement encapsulation in java? 
 
48% of the code has been tested. correct answers A set of Tests generate 48% code coverage. What does this mean? 
 
Methods correct answers When designing object-oriented systems what do verbs in a problem st...
Serializing Objects correct answers An object can be represented as a sequence of bytes that includes the objects data as well as information about the objects type and the types of data stored. 
 
Super() correct answers A method call in a sub class constructor invokes the superclass constructor 
 ...
Preview 2 out of 6 pages
Add to cartSerializing Objects correct answers An object can be represented as a sequence of bytes that includes the objects data as well as information about the objects type and the types of data stored. 
 
Super() correct answers A method call in a sub class constructor invokes the superclass constructor 
 ...
(T/F) Type parameters work with arrays without need for adjustment correct answers FALSE 
 
Correct type parameter implementation for an array correct answers private T[] b = (T[])new Object[]; 
 
Subtype correct answers "Is-A" of all things above 
 
Code to restrict type parameter "T" to someth...
Preview 1 out of 2 pages
Add to cart(T/F) Type parameters work with arrays without need for adjustment correct answers FALSE 
 
Correct type parameter implementation for an array correct answers private T[] b = (T[])new Object[]; 
 
Subtype correct answers "Is-A" of all things above 
 
Code to restrict type parameter "T" to someth...
What is the motivation for writing multithreaded Java code? correct answers Capture logical structure of problem, better utilize hardware resources 
 
What are possible states for Java threads? correct answers New, Runnable, Running, Blocked, Dead 
 
What is the effect of invoking the start( ) metho...
Preview 1 out of 4 pages
Add to cartWhat is the motivation for writing multithreaded Java code? correct answers Capture logical structure of problem, better utilize hardware resources 
 
What are possible states for Java threads? correct answers New, Runnable, Running, Blocked, Dead 
 
What is the effect of invoking the start( ) metho...
interpreter correct answers reads high level program and executes it; processed by alternating reading lines and executing instructions 
 
compiler correct answers reads all program lines before beginning to execute code (this does not exist in Python to keep debugging fast) 
 
shell correct answers...
Preview 1 out of 3 pages
Add to cartinterpreter correct answers reads high level program and executes it; processed by alternating reading lines and executing instructions 
 
compiler correct answers reads all program lines before beginning to execute code (this does not exist in Python to keep debugging fast) 
 
shell correct answers...
Shell mode correct answers A style of using Python where we type expressions at the command prompt, and the results are shown immediately. Contrast with source code, and see the entry under Python shell. 
 
Program mode correct answers write an entire program by placing lines of Python instructions ...
Preview 2 out of 11 pages
Add to cartShell mode correct answers A style of using Python where we type expressions at the command prompt, and the results are shown immediately. Contrast with source code, and see the entry under Python shell. 
 
Program mode correct answers write an entire program by placing lines of Python instructions ...
Types of applications correct answers Console application, GUI application, web application 
 
Syntax error correct answers An error from python not being able to understand something, usually a typo 
 
Runtime error correct answers An error that happens while a program is running 
 
Logic error cor...
Preview 1 out of 4 pages
Add to cartTypes of applications correct answers Console application, GUI application, web application 
 
Syntax error correct answers An error from python not being able to understand something, usually a typo 
 
Runtime error correct answers An error that happens while a program is running 
 
Logic error cor...
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Stuvia is a marketplace, so you are not buying this document from us, but from seller sh3rrymagdah. Stuvia facilitates payment to the seller.
No, you only buy these notes for $24.99. You're not tied to anything after your purchase.
4.6 stars on Google & Trustpilot (+1000 reviews)
72042 documents were sold in the last 30 days
Founded in 2010, the go-to place to buy study notes for 14 years now