How do you avoid global variables?
Answer / Poonam Rani Chauhan
Avoid using global variables by minimizing their use, limiting their scope to methods or blocks when necessary, and preferring local variables instead. Encapsulation through classes and private access modifiers can also help limit the visibility of variables.
| Is This Answer Correct ? | 0 Yes | 0 No |
Name the package that always imported by default?
what is Vector class?
how to create multithreaded program? Explain different ways of using thread? : Java thread
How do you sort a string in alphabetical order in java?
What is a treemap in java?
Is null a value?
Difference between Hash Table and Hash Map?
how to pass the parameters to applets?
Explain the difference between a Thread and a Process.
What will happen when using pass by reference in java?
What is the static keyword?
Difference between start() and run() method of thread class?