What is the difference between static and global variables and also define what are volatile variables?
Answer / Ram Updesh Singh
Global variables belong to the class scope, while static variables belong to the class scope but can be accessed without creating an object of the class. Volatile variables in Java are used for variables that are modified by multiple threads. They ensure that the value is always up-to-date and thread-safe.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can we create constructor in abstract class ?
What if static is removed from main method?
What are void pointers?
Can we declare an array without size in java?
What do you mean by global variable?
Can I overload to string method
Is it possible to specify multiple jndi names when deploying an ejb?
What is use of super keyword?
What is immutability in java?
What is finalize method?
how to deploy apache tomcat server to weblogic server in java
What best practices should you follow while writing multithreaded code in java?