Solved

how pass part of array as parameter

Posted on 2000-05-06
3
222 Views
Last Modified: 2008-02-20
can I pass part of array as parameter or new a sub array from a array without
copying data? thanks.

tony tan
0
Comment
Question by:tanfengkui
[X]
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
3 Comments
 
LVL 4

Expert Comment

by:adam923
ID: 2785016
no, you can't pass a sub-array without copying data
you could pass the array and the first and last indicies to the method and then the method could be programmed to just look at the subarray between those indicies
if you have an array of objects just go ahead and copy them, only the references will copy so it won't waste much space
0
 

Accepted Solution

by:
funduraghu earned 10 total points
ID: 2788186
Part of array cannot be passed to a method directly.
If u want a sub array, the required elements are needed to be copied onto a new array



0
 
LVL 4

Expert Comment

by:adam923
ID: 2789073
did you say anything new in your "answer"?
i think not
kindly withdraw your "answer"
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn different types of Android Layout and some basics of an Android App.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

617 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