Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is indexof?

1030


What is the difference between the ">>" and " >>>" operators in java?

1031


Describe how to implement singleton design pattern in struts.

1068


What is the difference between hashmap and hashtable? What is an interface?

1234


Explain the difference between the public, private, final, protected, and default modifiers?

1095


What is the difference between a switch statement and an if statement?

1136


What is an object class?

1074


What is the difference between heap memory and stack memory?

1120


What are the restrictions imposed by a Security Manager on Applets?.

2648


Is integer a class?

1131


What happens when heap memory is full?

1035


Can a main method be overloaded?

1069


Is string thread safe in java?

1141


What is type inference in java8?

1105


Is age discrete or continuous?

1192