public class CarServices {
private CarServices() { } // Prevents instantiation
//some methods
}
I prevent the constructor from been instantiated is this the correct way, or am I missing something?
public class CarServices {
private CarServices() { } // Prevents instantiation
//some methods
}
I prevent the constructor from been instantiated is this the correct way, or am I missing something?
You can mark your class - abstract:
public abstract class CarService{
...
}
We can't create instance for abstract class, only extends for this class.