nov1 notes - what does it print 25 7 25 25 Every parameter...

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

View Full Document Right Arrow Icon
public class Test { public void test_it (int n) { // 2nd step n=7; //3rd step } public static void main string [ ] args ) { //do not initializes any variables if the first thing you do is to assign a new value int n = 0; n = 25; // first step test_it (n); // 4th step } //suppose we use system.out.println("n="+n); in positions 1~4
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: what does it print? 25 7 25 25 Every parameter passes to a java method is passed by value. Java makes a new variable with the parameter name and operates on this local copy - no change to original....
View Full Document

This note was uploaded on 10/12/2009 for the course CSC CSC 110 taught by Professor Anne during the Fall '04 term at University of Victoria.

Ask a homework question - tutors are online