Interviews17 answers
Can we have all the classes static in an application?
17 Answers
Although you can do it but it is not a good practice since it will occupier more memory.
Khaleek AhmadPosted Feb 2, 2017, 9:05 PM EST
Yes, We can. Based on requirement.
Sreekanth ReddyPosted Dec 7, 2016, 4:19 PM EST
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 kumarPosted Oct 7, 2016, 6:10 AM EDT
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 PanditPosted Jul 4, 2016, 9:37 AM EDT
No appropriate need we can use
Thiruppathi RPosted May 25, 2016, 7:23 PM EDT
Yes you can have but Its not advised
Tijo JoyPosted Apr 28, 2016, 11:45 AM EDT
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 SrivastavaPosted Apr 25, 2016, 6:14 PM EDT
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 ChavanPosted Apr 6, 2016, 5:07 AM EDT
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 BabuPosted Apr 2, 2016, 3:16 AM EDT
yes we can have all the classes static.
Anil JhaPosted Apr 1, 2016, 8:27 PM EDT
Yes we can have all the classes static in an application?
Vivek KumarPosted Mar 31, 2016, 12:06 AM EDT
Yes we can have all classes static.
Keerthi VenkatesanPosted Mar 30, 2016, 9:55 PM EDT
yes we can have.
Sreekanth ReddyPosted Mar 15, 2016, 1:24 AM EDT
technically yes we can,logically no we can't
Sherif KhaledPosted Feb 23, 2016, 7:23 AM EST
Yes ! we can have all the classes static in an application
Pankaj Kumar ChoudharyPosted Feb 9, 2016, 4:23 PM EST
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 MurmuPosted Feb 1, 2016, 8:39 PM EST
I think yes we can.
Nishant MittalPosted Feb 1, 2016, 1:53 AM EST












