Ujjval Shukla
Can we have all the classes static in an application?
By Ujjval Shukla in C# on Jan 29 2016
  • Anil Kumar Murmu
    Feb, 2016 2

    If we have declared all classes as static in a application the we have to be careful in using only public , private or internal access modifiers. In a web application we have events which are protected. Hence, we can not mark the class as static.

    • 2
  • Deeksha Pandit
    Jul, 2016 4

    Yes. Why not you can have all your classes static in an application but this is not recommended and memory consumption will be high. Being a programmer, we must care of memory management / garbage collector, we should write code using best practices and recommended way.

    • 1
  • Sherif Khaled
    Feb, 2016 23

    technically yes we can,logically no we can't

    • 1
  • Khaleek Ahmad
    Feb, 2017 3

    Although you can do it but it is not a good practice since it will occupier more memory.

    • 0
  • Sreekanth Reddy
    Dec, 2016 7

    Yes, We can. Based on requirement.

    • 0
  • kiran kumar
    Oct, 2016 7

    Yes, We can have all classes as static so that no object creation of the classes is required. If Class is static type then all its members should be static type and Static can't be instanced as they are loaded into the memory in very early and also they consume more and more amount of memory and ultimately causes the reduction of performance of the application. The static class members are accessed with the class name itself.

    • 0
  • Thiruppathi R
    May, 2016 25

    No appropriate need we can use

    • 0
  • Tijo Joy
    Apr, 2016 28

    Yes you can have but Its not advised

    • 0
  • Ashish Srivastava
    Apr, 2016 25

    Yes Practically- Yes but if you all the classes static then it will be loaded in memory all the time, It will consume the memory.

    • 0
  • Rahul Chavan
    Apr, 2016 6

    Yes and No. Practically- Yes but if you all the classes static then it will be loaded in memory all the time, It will consume the memory.

    • 0
  • Sunil Babu
    Apr, 2016 2

    No,It is not recommended because it decreases performance as it increases load,gives error inputs as data remains in till it is cleared .

    • 0
  • Anil Jha
    Apr, 2016 2

    yes we can have all the classes static.

    • 0
  • Vivek Kumar
    Mar, 2016 31

    Yes we can have all the classes static in an application?

    • 0
  • Keerthi Venkatesan
    Mar, 2016 31

    Yes we can have all classes static.

    • 0
  • Sreekanth Reddy
    Mar, 2016 15

    yes we can have.

    • 0
  • Pankaj  Kumar Choudhary
    Feb, 2016 9

    Yes ! we can have all the classes static in an application

    • 0
  • Nishant Mittal
    Feb, 2016 1

    I think yes we can.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS