My excample:
First class:
public class Customer {
int amount;
}
Second class:
public class Invoice {
Customer [] amount_one = {};
int amount_all() {
int total = 0;
for (int i = 0; i <= amount_one.length; i++) {
total = total+amount_one[i] // Don't work!
}
return null; // Don't work!
}
}
What is the correct code?
Can you show me a working example?