I have this class
class Customer{
int ID;
Time arriveTime;
Time serviceTime;
Time completeTime;
int transaction;
}
Don\'t I
Yes, you need a constructor to assign parameters to your class during object creation, or you could reference each variable individually though the instance and assign it, e.g:
Customer c = new Customer();
c.id = 0;
// etc
A constructor just makes this easier as you do not need to write more code than necessary.
I do recommend using constructors to assign various values to a class instance instead of doing it manually every time you create an instance of an object.