If your team member writes code with lots of static
variables and static methods, will it cause any side effects?
Answer Posted / 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 |
Post New Answer View All Answers
What is a class in java?
What are measurable parameters?
What is meant by object oriented programming – oop?
Is java ee a framework?
What is serial version uid and its importance in java?
What is the difference between assignment and initialization?
What is contract between hashcode and equal method?
Explain OOPs concept.
How objects of a class are created if no constructor is defined in the class?
Can an anonymous class be declared as implementing an interface and extending a class in java programming?
Can we override the static method?
Is alive method in java?
How to convert string to byte array and vice versa?
Give a brief description of java socket programming?
What does singleton mean in java?