100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSCI300 FINAL EXAM Flashcards _ 100- SURE ANSWERS) 2024 - DISTINCTION GUARANTEED.pdf $7.99   Add to cart

Exam (elaborations)

CSCI300 FINAL EXAM Flashcards _ 100- SURE ANSWERS) 2024 - DISTINCTION GUARANTEED.pdf

 0 view  0 purchase
  • Course
  • CAIA - Chartered Alternative Investment Analyst
  • Institution
  • CAIA - Chartered Alternative Investment Analyst

CSCI300 FINAL EXAM Flashcards _ 100- SURE ANSWERS) 2024 - DISTINCTION GUARANTEED.pdf

Preview 3 out of 28  pages

  • August 9, 2024
  • 28
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CAIA - Chartered Alternative Investment Analyst
  • CAIA - Chartered Alternative Investment Analyst
avatar-seller
Denyss
8/9/24, 4:57 AM




CSCI300 FINAL EXAM
Jeremiah




Terms in this set (107)




1/28

,8/9/24, 4:57 AM
Consider the following class definition: b) Redefine addEm to return the value of z+super.addEm(), but leave changeEm alone.
public class AClass
{
protected int x;
protected int y;
public AClass(int a, int b)
{
x = a;
y = b;
}
public int addEm()
{
return x + y;
}
public void changeEm()
{
x++;
y--;
}
public String toString()
{
return "" + x + " " + y;
}
}


You want addEm to now add all three values,
return the sum, and changeEm to change x
and y, but leave z alone. Which should you
do?


a) Redefine addEm and changeEm without
referencing super.addEm() or
super.changeEm().
b) Redefine addEm to return the value of
z+super.addEm(), but leave changeEm alone.
c) Redefine changeEm to call
super.changeEm() and then set z = x + y, but
leave addEm alone.
d) Redefine addEm to return the value of
z+super.addEm() and redefine changeEm to
call super.changeEm() and then set z = x + y.
e) Redefine changeEm to call
super.changeEm() without doing anything to
z, and redefine addEm to return
super.addEm().




2/28

, 8/9/24, 4:57 AM CSCI300 FINAL EXAM Flashcards | Quizlet
Assume that Student, Employee and Retired e) This cannot be determined by examining the code
are all extended classes of Person, and all
four classes have different implementations
of the method getMoney. Consider the
following code where ... indicates the
required parameters for the constructors:
Person p = new Person(...);
int m1 = p.getMoney(); // assignment 1
p = new Student(...);
int m2 = p.getMoney(); // assignment 2
if (m2 < 100000)
p = new Employee(...);
else if (m1 > 50000)
p = new Retired(...);
int m3 = p.getMoney(); // assignment 3


The reference to getMoney() in assignment 3
is to the class:


a) Person
b) Student
c) Employee
d) Retired
e) This cannot be determined by examining
the code

Aside from permitting inheritance, the a) permit access to the protected item by any class defined in the same package
visibility modifier protected is also used to:


a) permit access to the protected item by
any class defined in the same package
b) permit access to the protected item by
any static class
c) permit access to the protected item by
any parent class
d) ensure that the class cannot throw a
NullPointException
e) define abstract elements of an interface

Java does not support multiple inheritance b) implementing interfaces
but some of the abilities of multiple
inheritance are available by:


a) importing classes
b) implementing interfaces
c) overriding parent class methods
d) creating aliases
e) using public rather than protected or
private modifiers

A is a derived class of X. (True or False?) False


x
/\
yz
/\

AB
CSCI300 FINAL EXAM

https://quizlet.com/906241882/csci300-final-exam-flash-cards/ 3/28

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

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!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

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.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Denyss. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76462 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart