Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do we have to make new on Static class

While going through the documentation, i read some where that ViewHolder is a static class, but does it require to make new on static class? In that example they have done new on it?, but according to the concept new should not be done on static class right?

like image 408
Naruto Avatar asked Oct 09 '22 01:10

Naruto


1 Answers

You can only construct classes four ways:

  1. Using "new"
  2. Using using Class.newInstance
  3. Using a method / factory that internally uses new to create a new instance
  4. Using object.clone, if it is supported

1 and 3 are by far the most used

like image 154
ControlAltDel Avatar answered Oct 13 '22 11:10

ControlAltDel