Quiz5.fa09

Quiz5.fa09 - Signature _____________________ CSE 11 Name

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: Signature _____________________ CSE 11 Name ________________________ Quiz 5 cs11f ____ Fall 2009 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no calculators. Given the following partial class definition for Point, fill in the blanks to complete the class definition: Assume you are given the array definition below and the array is properly initialized: public class Point { private int x; private int y; public Point( int x, int y ) { setX( x ); setY( y ); } public int getX() { ____________________________; } public int getY() { ____________________________; } public void setX( int x ) { ___________________________; } public void setY( int y ) { ___________________________; } } Point points = new Point[10]; // Assume array points is properly and fully initialized here Without using any extra variables other than the variable points , write the single Java statement to change the first Point's x value to be the same value as the last Point's y value. Do not use any magic numbers or the first Point's x value to be the same value as the last Point's y value....
View Full Document

This note was uploaded on 01/07/2011 for the course CSE CSE11 taught by Professor Cs during the Spring '10 term at UCSD.

Page1 / 2

Quiz5.fa09 - Signature _____________________ CSE 11 Name

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