- 1
Can you explain the most easist way to call array in a object with the help of example
I dont undrestant how array can be called in object multiple time in a different methods
5 Answers
+ 3
We can only help you if you post the code
0
Could you please clarify your question?
0
How to call a array into a object..explain with eg
0
I don't understand exactly what you mean. If you want to pass an array to a custom class, then define constructor which takes array as an argument.
- 1
if you want to call a method by passing array then :
class A{
int[] a;
public void takeArry(int[] a){
this.a = a;}
public static void main(String... arg){
A newA = new A();
newA.takeArry(new int[]{1,2,3,4});
System.out.println(a),
}}