![]() |
|
| Java Interview / Technical Questions Kindly solve an many as questions you can. It will sharpen your skills and those solutions will help others too. |
![]() |
| LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Junior Member Join Date: Jul 2006
Posts: 1,391
Thanks: 1
Thanked 28 Times in 25 Posts
Rep Power: 19 | J2EE - What is the difference between transient variable, volatile variable What is the difference between transient variable, volatile variable <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> |
| | |
| The Following User Says Thank You to preethisingh For This Useful Post: | lalitha devi (08-10-09)
|
| | #2 (permalink) |
| Junior Member Join Date: Apr 2008 Age: 1
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 | volatile modifier requests the Java VM to always access the shared copy of the variable so the its most current value is always read. If two or more threads access a member variable, AND one or more threads might change that variable's value, AND ALL of the threads do not use synchronization (methods or blocks) to read and/or write the value, then that member variable must be declared volatile to ensure all threads see the changed value.when you don't want to serialize a member variable then you define that variable as transient. |
| | |
![]() |
| Tags |
| difference , j2ee , transient , variable , volatile |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need .Net Interview Questions | vidyasagarkumar | VB / ASP.NET Technologies | 6 | 06-09-07 12:37 AM |
| J2EE - What is the difference between classpath and path variable? | preethisingh | Java Interview / Technical Questions | 0 | 23-01-07 02:37 PM |
| J2EE - What is the difference between a field variable and a local variable? | preethisingh | Java Interview / Technical Questions | 0 | 23-01-07 01:59 PM |
| C language -What is the difference between declaring a variable and defining a variable? | GEEK | ds. c , c++ Interview / Technical Questions | 0 | 23-01-07 01:39 PM |
| Java Contest-13 with answers | keerthi | JAVA Technologies | 8 | 31-12-06 09:44 AM |
| More Interview Questions Here... |