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
Which api is provided by java for operations on set of objects?
What is a stack class in java ?
Can you override static methods?
Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).
why an outer class cannot be declared as private?
What are thread priorities and importance of thread priorities in java?
How many types of gc are there in java?
What is a constructor overloading in java?
What is a singleton class in Java?
Is set sorted in java?
What is the exact difference in between Unicast and Multicast object? Where will it be used?
What is jvm? How its run?
Why is it called boolean?
How do I get the | symbol on my keyboard?
What is getkey () in java?