It's not a secret anymore!*
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ans is 4 but how ? (Method invocation)