8_Quiz - 6. Give the default values for the following...

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 (int 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.  _______________
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: 6. Give the default values for the following primitive data types: a. int _______ b. double _______ c. boolean ________ 7. What is the problem with this constructor for the class Fraction ? What illegal/invalid object will it allow to be constructed? public Fraction (int n, int d) { num = n; denom = d; } 8. Using the constructor from #7 above, write (in one statement) a declaration of a new fraction, f1, and initialize it to be . (6 point question) 9. True or False: a. A method can change a primitive data type that is passed to it. ________________ b. A method can change an object that is passed to it. _______________...
View Full Document

This note was uploaded on 01/24/2012 for the course HUM 9999 taught by Professor Variousprofessorslisted during the Summer '06 term at Abilene Christian University.

Page1 / 2

8_Quiz - 6. Give the default values for the following...

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