[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


return a pointer to an array of strings

Posted on 2004-10-31
Medium Priority
Last Modified: 2010-03-31
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++
Question by:komlaaa
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 92

Expert Comment

ID: 12460134
public String[] getArray()
   return array;

Author Comment

ID: 12460142
and how do i catch it?
like String array[] = MyObject.getArray(); ?
LVL 92

Accepted Solution

objects earned 200 total points
ID: 12460150
yes thats right

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question