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 do you understand by garbage collection in Java? Can it be forced to run?
Define inheritance with reference to java.
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
How will you add panel to a frame?
Why we go for collections in java?
Why are the destructors for base class and derived class called in reverse order when the program exits
What does it mean that a method or field is “static”?
What's the default access specifier for variables and methods of a class?
How do you convert boolean to boolean?
Can I declare class as static or private?
What is the difference between the font and fontmetrics classes in java programming?
What is immutable class in java?
Is a case study a method or methodology?
What does || mean in code?