Create new Calendar object???
hi everyone,
well here is my code:
private static SimpleDateFormat formatter = new SimpleDateFormat("dd. mm. yyyy hh:mm:ss");
public void print(Calendar begin){
Calendar end= Calendar begin;
end.add(Calendar.HOUR_OF_DAY,3);
System.out.println("begin:" + formatter.format(begin.getTime()));
System.out.println("end:" + formatter.format(begin.getTime()));
}
Well the output is begin and end are both the same, that mean after end.add, both begin and end were added.
How can i creat a new Calendar object, that has 3hours more than the current Calendar i have, without changing the current Calendar?
many thanks:)