• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

CPSC 2150 Midterm 2 || All Correct.

Document preview thumbnail
Preview 2 out of 7 pages

Why are Generics useful? correct answers Generics make interfaces and classes reusable by parameterizing them Which is an example of a generic interface? a.) ListInteger b.) vectorDouble c.) Both a & b correct answers c Write some code for a stack interface correct answers public interface IStack T { public void push(T x); public T pop(); public int depth(); } How do you write code to set up a generic interface? correct answers IStackInteger si = new Stack1Integer(100) or IStackInteger si = new Stack1(100) T/F: Generics can only use wrapper types as parameters. correct answers False -- they can also use other reference types T/F: Generics can only use immutable types as parameters. correct answers False -- although immutable is better, mutable is allowed T/F: Objects are not immutable correct answers True How do you cast a parameterized object? correct answers contents = (T[]) new Object[d] All classes extend the Object class What 3 things do generics rely on? correct answers Reference Types References extend Object Reference types have an implementation for many methods What is a failure? correct answers Any deviation of the observed behavior from the specified behavior Erroneous State correct answers The system is in a state of no return. Any further processing will result in a failure. Fault correct answers The bug or mechanical flaw that causes the system to be in an erroneous state. Test Component correct answers Part of the system that can be isolated for testing.


Document information

Uploaded on
March 25, 2024
Number of pages
7
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$11.69

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ProPerfomer
3.8
(84)
Sold
451
Followers
322
Items
8858
Last sold
2 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.