Link to home
Start Free TrialLog in
Avatar of komlaaa
komlaaa

asked on

return a pointer to an array of strings

Hi Experts,

let  private String array[] = { "a", "b", "c"} a data member of my class.
is there anyway i can use an accessor method like getArray( )  that can return a point to that array.
something like:

I know this can be done in C++
Avatar of Mick Barry
Mick Barry
Flag of Australia image

public String[] getArray()
{
   return array;
}
Avatar of komlaaa
komlaaa

ASKER

and how do i catch it?
like String array[] = MyObject.getArray(); ?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial