Explain the difference between transient and volatile in java?
Answer / Anju
Transient is a keyword used to indicate that a variable should not be serialized. This means that when an object is serialized (converted into bytes), the transient variables will be ignored. Volatile, on the other hand, is a keyword used to indicate that a variable may be accessed by multiple threads and its value can change at any time. The JVM ensures that any thread reading the volatile variable always gets the most recent value.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain the features of interfaces in java?
How do you use compareto in java?
What is instance means in java?
What are parent methods and how can you call them?
how to write a program for chat function using core java
How many bits are used to represent unicodde,ASCII,UTF-16 and UTF-8 characters?
Will minecraft java be discontinued?
What is the static block?
Why are there no global variables in java?
Can we declare register variable as global?
Why hashmap is used in java?
What is difference between path and classpath?