If your team member writes code with lots of static
variables and static methods, will it cause any side effects?

Answers were Sorted based on User's Feedback



If your team member writes code with lots of static variables and static methods, will it cause any..

Answer / abhinav

If the code is small, then there wont be any significant
problems, but if the program is huge, then it can severly
hamper the program performance. use of static
variables/methods are one of the biggest reasons for memory
leaks

Is This Answer Correct ?    6 Yes 2 No

If your team member writes code with lots of static variables and static methods, will it cause any..

Answer / eknath wagadre

Yes!!! We can define the several static method and variable
and those are vary easy to access by Class Name or by class
instance.

But Only problem with static method and variable is that
there is Maximum chance of data corruption. bcz of static
method and variable are accessed by diff-2 thread at the
same time. Mean at the same time one or more then one thread
can change the value of static variable.

So conclusion is this if we can define more static variable
and method so and our program have hug line of code at that
time programs output may be inconsistent.

Is This Answer Correct ?    0 Yes 0 No

If your team member writes code with lots of static variables and static methods, will it cause any..

Answer / ravi jain

Abhinav pls explain more.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is ++ a in java?

0 Answers  


What are the traverses in Binary Tree?

2 Answers   Adobe, Infosys,


Difference between String & StringBuffer

16 Answers   IBM, Infosys, Tech Mahindra, Wipro,


How to print nodes of a Binary tree?

1 Answers   TCS,


What are features of java?

0 Answers  






Is char a method in java?

0 Answers  


What is the primitive type short?

0 Answers  


What is treemap in java?

0 Answers  


How can you avoid serialization in child class if the base class is implementing the serializable interface?

0 Answers  


What is anagram in java?

0 Answers  


What java ide should I use?

0 Answers  


Difference between overloading and Overriding. <Giving a confusing example to test the concept.> (also asked in PA Consultancy Group,iflex,Value chain,IBM,CTS,Accenture, Tarang>

12 Answers   Accenture, CTS, Extensio, IBM, iFlex, PA Consulting, Symphony, Tarang,


Categories