ChangingPeople

ChangingPeople - ChangingPeople.java Demonstrates parameter...

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

View Full Document Right Arrow Icon
// ********************************************************************** // ChangingPeople.java // // Demonstrates parameter passing -- contains a method that should // change two Person objects. // ********************************************************************** public class ChangingPeople { // --------------------------------------------------------- // Sets up two person objects, one integer, and one String // object. These are sent to a method that should make // some changes. // --------------------------------------------------------- public static void main (String[] args) { Person person1 = new Person ("Sally", 13); Person person2 = new Person ("Sam", 15); int age = 21; String name = "Jill"; System.out.println ("\nParameter Passing. .. Original values. .."); System.out.println ("person1: " + person1); System.out.println ("person2: " + person2); System.out.println ("age: " + age + "\tname: " + name + "\n"); changePeople (person1, person2, age, name); System.out.println ("\nValues after calling changePeople.
Background image of page 1

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

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

This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Page1 / 2

ChangingPeople - ChangingPeople.java Demonstrates parameter...

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