Question:
Constructor vs method?
Author: Ed HowardAnswer:
A constructor should initialize the object, method perform actions on the objects. *We can overload but not override. We can change type and/or number of parameters or to overload. We can use all access modifiers with a constructor. No non-access modifiers can be added. I created a constructor when I created the page object model when I was initializng the variables all at once. Construtors do not participate in inheritance so It can not be over ridden.
0 / 5 Â (0 ratings)
1 answer(s) in total