Man of Honour
- Joined
- 15 Mar 2004
- Posts
- 28,140
- Location
- Liverpool
Hi, I was wondering how to call certain methods in Java?
I have a class file which contains different methods, and I'm supposed to create a main.java file such that the results of these is called and I can then display it. I'm not sure how to do this though.
One of the methods is:
and to call it we've been told that:
Given a n-element array, L, whose value are distinct integers, the statement
will return an n + 1 element integer array in
which {P[1], P[2], . . . , P[n]} hold all of the elements in L sorted into ascending order, i.e. for each element L some position j in P will have P[j] = L; furthermore for each k with 1 ≤ k < n, the value P[k] will be less than the value P[k + 1].
Any help recieved will be gratefully receieved. Quite stuck on this
Edit - letters have been changed because otherwise it's confusing..
I have a class file which contains different methods, and I'm supposed to create a main.java file such that the results of these is called and I can then display it. I'm not sure how to do this though.
One of the methods is:
Code:
static int[ ] Method1(int[ ] L, int n)
and to call it we've been told that:
Given a n-element array, L, whose value are distinct integers, the statement
Code:
P = Sorting.Method1(L,n);
which {P[1], P[2], . . . , P[n]} hold all of the elements in L sorted into ascending order, i.e. for each element L some position j in P will have P[j] = L; furthermore for each k with 1 ≤ k < n, the value P[k] will be less than the value P[k + 1].
Any help recieved will be gratefully receieved. Quite stuck on this

Edit - letters have been changed because otherwise it's confusing..
Last edited: