1 Answer - Sort by: Date | Rating
Pass it to the next method, ensure the method being passed to has the correct parameters.
Ie
void CreateArray()
{
int[] intArray = {1,3,2,4,3,5}; //Create the array
DoStuffWithArray(intArray); // pass intArray to DoStuffWithArray
}
// other method within class
void DoStuffWithArray(int[] array)
{
print (array[0]); //print first element of the array passed to this method
}
Ie
void CreateArray()
{
int[] intArray = {1,3,2,4,3,5}; //Create the array
DoStuffWithArray(intArray); // pass intArray to DoStuffWithArray
}
// other method within class
void DoStuffWithArray(int[] array)
{
print (array[0]); //print first element of the array passed to this method
}
0
0
- How To Get Java On My Lg 260?
- Write A Java Program To Store A Number Find If It Is Positive Or A Negative Number If Positive Print I Am The First?
- How To Update The Sim 3 Expansion?
- What Is An Attribute In Java?
- Do I Have To Write A Main Method In Every Class I Create?
- What How The Step For Make Library Management?
- In Which Process We Can Start Java?
- Define The Concept Of Java Byte Code?
- How To Run Remote Method Invocation In More Machine?
- How To Run Java Remote Method Invocation In More Machine?
- How To Make A Java Program That Will Ask The User To Input A Number And Display All The Even Number And The Sum Of All Even Numbers Based On The Inputted/ Given Numbers?
- Is A Static Variable An Instance?
- How To Compile And Run Java Package?
- What Does Literati-on Mean?
- What Is Abstract Class In Details?
- What Is Meant By Remote Method Invocation In Java?
- What Is Meant By Servlet In Java?
- What Is Latest Technologies In Java?
- Write A Program Using Do…..while Loop To Calculate And Print The First M Fibonacci Numbers?
- What Is The Difference Between Reference &instance Variable?
- Why Java Is Slow?
- What Is The Drawback Of Ms Access?
- What Is Replaced In Place Of Pointers In Java?
- What Replaces Pointers In Java?
- How Many Types We Create Object In Java?
- What Is A Simple Java Program Of Array With Method?
- Is Array A Class Or A Variable?
- What Is The Difference Between Abstract Class And Abstract Method?
- Can A Main() Method Of Class Be Invoked In Another Class?
- Can An Abstract Class Have Any Final Method?
- Why Sleep Method Not In Object Class It In Thread Class?
- Why Is The Sleep Method Given As Static In The Thread Class In Java?

New Comment - Comments are editable for 5 min.