Hi Lucky , This is an important topic as per exam point of view I scored least in this topic. Date is old class now but still in use for formatting date and stuff. Calendar is relatively programmer friendly class. for e.g. in Date class if you say Date d = new Date(); and now if you print the Date object d you will see current date. Now if you need to add an hour to current time it will be something like d.setTime(d.getTime +3600000);
so just imagine in your application if you need to add a year or a month or some x amount of hours you will be dead by the time you are done the calculations of adding stuff.
Calendar class is very programmer friendly class so now if you want to ask a month to a date using Calendar class which is ab abstract class Calendar cal= Calendar.getInstance(); cal.setTime(d) cal.add(Calendar.Month,1);
so calendar is newer class and used mostly to make things easy for us . The best way to understand this topic is to write some programs execute them be innovative and this forum is always there if you are stuck some place
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad: