Building

Building - b1.residents[1] = new...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Building{ private int [ ] roomNumbers; private Resident [ ] residents; public Building( ){ roomNumbers = new int [4]; residents = new Resident [4]; } public static void main(String args [ ]){ Building b1 = new Building( ); b1.residents[0] = new Resident("joe");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b1.residents[1] = new Resident("sam"); b1.residents[0].addFriend(b1.residents[1]); b1.roomNumbers[0] = 101; b1.roomNumbers[1] = 102; IO.printString(b1.residents[0].getFriend(0).getName( ) ); } }...
View Full Document

This note was uploaded on 07/12/2009 for the course CS 111 taught by Professor Hari during the Fall '08 term at Rutgers.

Ask a homework question - tutors are online