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 does system out println () do?
State some situations where exceptions may arise in java?
In a container there are 5 components. I want to display the all the components names, how will you do that one?
How many types of array are there?
What are the data types supported by java? What is autoboxing and unboxing?
Why super is first line in java?
What is method reference?
What are abstract methods in java?
Write a program to print the pattern given below
What is the unit of plancks constant?
what is the difference between thread and runnable types? : Java thread
What is functional interface in java?
What is the difference between stream and buffer?
List some important characteristics on jre
Can we have two methods in a class with the same name?