This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ans is 4 but how ? (Method invocation) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

ans is 4 but how ? (Method invocation)

Talal Shaikh
Greenhorn

Joined: Jul 17, 2001
Posts: 13
public class example {
int a[] = {0};
public static void main (String args[]){
int i[] = {1};
change_i(i);
System.out.println(i[0]);
}
public static void change_i(int i[]) {
i[0] = 2;
i[0] *= 2;
}
}
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
I've tried answering you in this thread.
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

Please don't post the same question in multiple forums. You can continue the discussion in the Java In General Forum (see link in Anthony's post)


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
 
 
subject: ans is 4 but how ? (Method invocation)
 
Similar Threads
Please explain
Arrays
Doubt about Array
doubt in arrays
HOw does this work.. the ans is 4 but there is no return statement