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


Please Help Members By Posting Answers For Below Questions

What is a null check?

762


What is a bubble sort in java?

739


What is the default value of an object reference declared as an instance variable?

791


What is java used for?

787


What is the meaning of variable in research?

776


What is java basic concept?

804


Are strings immutable in java?

746


How do you override a variable in java?

751


What is return code?

774


Explain notifyall() method of object class ?

872


Why for each loop is used?

761


What is a final class in java?

782


Why are getters and setters used?

787


How can we create an immutable class in java?

819


Is array a class in java?

737