Please help to resolve the below inquiry. There are 2 classes (Main & Account)
In main class, I am getting scanner input value and passing this value as a integer array to account class. In Account class, I need to read this array and display the values.
Main class and Main function:(I need to get input one by one and display the appended values)
System.out.println("Enter the array value");
Array arrayobj = new Array();
int value = scan.nextInt();
Integer[] valuearr = new Integer[1];
valuearr[0] = value;
arrayobj.add(valuearr);
Account class : (Add method)
public void add(Integer[] a) {
System.out.println("The values are")
}
*My input and output should be like this..
##*
Enter your choice:
1. Add
1 ----------------------selecting 1 option
Enter the array value
1
The values are (Output)
1
Do you want to continue?
Yes
Enter your choice:
1. Add
1 ----------------------selecting 1 option
Enter the array value
2
The values are (Output)
1
2 ##