nov1 notes2 - } //suppose we use...

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

View Full Document Right Arrow Icon
public class Test { public int test_it (int n) { // 2nd step n=7; //3rd step return (n); } 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; int x; n = 25; // first step x=test_it (n); // 4th step
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } //suppose we use system.out.println("n="+n); in positions 1~4 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