Search:

Type: Posts; User: jps

Search: Search took 0.09 seconds.

  1. Thread: passing arguments

    by jps
    Replies
    19
    Views
    1,519

    Re: passing arguments

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package myproject;

    /**
    *
    * @author User
    */
  2. Thread: passing arguments

    by jps
    Replies
    19
    Views
    1,519

    Re: passing arguments

    Don't just try in one method, comment the lines with new in both doit and f, and run it.
  3. Thread: passing arguments

    by jps
    Replies
    19
    Views
    1,519

    Re: passing arguments

    My advice is to comment the line in question, run it, and see what happens. Post back if you have questions after a little trial and discovery.
  4. Thread: passing arguments

    by jps
    Replies
    19
    Views
    1,519

    Re: passing arguments

    ..an addon to my previous post. When you passed a to doit, var your original array with five zeros in it becomes lost. So it is important to realize you did not modify a in the sense that the loop in...
  5. Thread: passing arguments

    by jps
    Replies
    19
    Views
    1,519

    Re: passing arguments

    Correct. However, you have not compared apples to apples.

    Function doit(int[] var) does not modify array a either. Your difference lies in your calls.


    a=doIt(a);
    f(b);The first line,...
Results 1 to 5 of 5