File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic

ans is 4 but how ? (Method invocation)

 
Talal Shaikh
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 1055
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I've tried answering you in this thread.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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)
 
    Bookmark Topic Watch Topic
  • New Topic