Q about java arrays

From: johnny (squidish_at_hotmail.com)
Date: 11/30/03


Date: Sun, 30 Nov 2003 04:01:24 GMT

hello.
in C++, you can fake a sub-array by passing something
like (array + int). If this was passed to something that
takes an array as a parameter, the function will deal
with the array using the int as the starting value.
for example....

if we have some function with the declaration
void someFunctionOnSomeArray(int[] a)

and we have the data array
int[] data = { 1,2,3,4,5,6,7,8,9,0 };

and then we call it with
someFunctionOnSomeArray( data + 5 );

the function will have as the array "a" the values
{ 6,7,8,9,0 }

My Question:
Is there a way to do the same thing in java?

thanks
~johnny



Relevant Pages

  • (patch for Bash) regex case statement
    ... Following up on my previous patch for regex conditional tests, ... /* Return an array of strings; ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: Strategy or Iterator?
    ... It would be possible to write a class that returns the variations ... GNU General Public License for more details. ... protected CombinatoricOperator(Telements, int r) { ... An integer array backing up the original one to keep track of the ...
    (comp.lang.java.programmer)
  • (patch for Bash) regex conditional tests
    ... 'regex' are returned in array variable SUBMATCH. ... Skipping of positional parameters, array elements, string ... int dollarflag, zeropad, compareflag; ... SHELL_VAR *var; ...
    (comp.unix.shell)
  • Re: attempting an actual game...
    ... >>> and inflexible by the absurd decision to use a bit array for square ... as then one has 8 bits in which to store a color and a few flags ... Using a 2D int (or, ... > Change direction and you may eventually complete a game. ...
    (comp.games.development.programming.misc)
  • Re: Warning on assigning a function-returning-a-pointer-to-arrays
    ... This declares pfunc as a function taking no arguments and returning ... int x, y; ... Presumably pfuncwill return a pointer to a single int, ... or the first of a sequence of "array 5 of int"s. ...
    (comp.lang.c)