0

Hi. I got a noobish question:

Is it possible to return an array "directly", so, something like this.

public int[] getArray(){

return int[]{this.intA, this.intB};

}

I know I can just make the array first. But does this not use unnecessary cpu time and memory? This is going to be used a lot, so performance is the most important element here.

Thanks:)

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Cort3z
0

Is it possible to return an array "directly",

Have you tried it with the compiler? Do you get errors?

0

Yes. I can't seem to find a legal way of doing this.

0

Ohh, yeah. Right ^^. Lol, I accually knew that when you mentioned it. Thank you.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.