guys, Please, can you clarify something for me?
As i understand (please correct me if i am wrong), when i pass the variables to a method or class i'm passing by value, isn't it?
if it's true, then why does Java has method .clone()?
Why do i ask this question, because i am very confused...here is the code: if i pass variables using the following code and then modify them inside the dialog, the original values (outside) are also changed.
DialogChoosePayment mDialogChoosePayment = new DialogChoosePayment(mContext, (ArrayList<Payment>) defaultValues.getPayment(), (ArrayList<Payment>) selectedValues);
mDialogChoosePayment.show();
But, if i use the following one, then the variables values (Original variables from outside) are not changed.
DialogChoosePayment mDialogChoosePayment = new DialogChoosePayment(mContext, (ArrayList<Payment>) defaultValues.getPayment().clone(), (ArrayList<Payment>) selectedValues.clone());
mDialogChoosePayment.show();
Please, explain it to a newbie =)