I was reviewing some code written by a colleague who is my senior. In a unit test class, he made use of private final
class variables like this:
public class SomeProcessingServiceUT {
private final String modelNumber = "ABC01";
private final String serialNumber = "000002";
private final String PrimaryId = "15033520583";
private final String CheckinTime ="20021010:00-05";
.....
}
And all he was doing was accessing all of these variables like this.modelNumber
etc and nothing else.
I want to question his intent as to why he did not declare pure constants by using static and why he used such mixed namings. But I thought of sharing my doubts here also with the community. This is a bit confusing. Any wisdom will be helpful.