8_M-upQuiz - { num = n; denom = d; } a. Write (in one...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
AP Computer Science Name ______________________________ Reading Quiz Chapter 8 (2 points per answer – 30 points total) 1.   Correct the syntax error in the following method header private int addSumofSq (count, sum) 2.   The code inside the brackets of the method is called the __________________ . 3.    Overloaded  methods are methods within the same class that have the same _______________       but different _________________ . 4.   Change the following method headers so that the two methods can be in the same class: public int fun(int a, double b) public double fun (int a, double b) 5.   True or False:   a. Constructors do not have the same name as their class.  __________________ b. Constructors have a  void  return type.  _______________ 6.   Give the default values for the following primitive data types: a.    int _______ b.    double _______       c.    boolean ________ 7.   Using the constructor below: public Fraction (int n, int d)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { num = n; denom = d; } a. Write (in one statement) a declaration of a new fraction, f1, and initialize it to be . ( 6 point question ) ____________________________________________________________________________ b. How would the constructor above change to allow the construction of fractions with real number numerators and denominators? ( 6 point question ) 8. (6 point question) The values of which kind of data types can be altered if they are passed directly into a method instead of a copy of the values? ______________________________________________ Will objects such as from Fraction above need a copy or will the original remain unaltered? _______ ______________________________________________________________________________...
View Full Document

Page1 / 2

8_M-upQuiz - { num = n; denom = d; } a. Write (in one...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online