What are Transient and Volatile Modifiers?
Answer Posted / harika.thota001@gmail.com
we can use volatile in the application where a lot of threads are working simultaneously. Each thread having its local copy for instance variable. If we use volatile then it will become master copy. All will access the master copy. so whatever is latest we can use.
While Transient is used in the case of serialization.
Serialization is a process of writing an object in the files.
if we use prefix transient with variable than that variable value will not store when we write the object in the file.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do you check if two strings are equal in java?
What do you know about the garbage collector?
How define set in java?
What is 32 bit float?
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
if u open login & logout ,how can udisplay the timelogin & logout members ?
Can we store variables in local blocks?
What is the tradeoff between using an unordered array versus an ordered array?
is it possible to instantiate the math class?
What is an example of declaration?
Is void a wrapper class?
What about main thread in java?
What is the biggest integer?
How do you sort a string in java?
What are exception handling keywords in java?