17
Reply

Can we have all the classes static in an application?

Ujjval Shukla

Ujjval Shukla

Jan 29, 2016
4.4k
0

    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.

    Anil Kumar Murmu
    February 02, 2016
    2

    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.

    Deeksha Pandit
    July 04, 2016
    1

    technically yes we can,logically no we can't

    Sherif Khaled
    February 23, 2016
    1

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

    Khaleek Ahmad
    February 03, 2017
    0

    Yes, We can. Based on requirement.

    Srikanth Reddy
    December 07, 2016
    0

    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.

    kiran kumar
    October 07, 2016
    0

    No appropriate need we can use

    Thiruppathi R
    May 25, 2016
    0

    Yes you can have but Its not advised

    Tijo Joy
    April 28, 2016
    0

    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.

    Ashish Srivastava
    April 25, 2016
    0

    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.

    Rahul Chavan
    April 06, 2016
    0

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

    Sunil Babu
    April 02, 2016
    0

    yes we can have all the classes static.

    Anil Jha
    April 02, 2016
    0

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

    Vivek Kumar
    March 31, 2016
    0

    Yes we can have all classes static.

    Keerthi Venkatesan
    March 31, 2016
    0

    yes we can have.

    Srikanth Reddy
    March 15, 2016
    0

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

    Pankaj Kumar Choudhary
    February 09, 2016
    0

    I think yes we can.

    Nishant Mittal
    February 01, 2016
    0