Which JAVA statement is correct PICK ONE OF THE CHOICES A th

Which JAVA statement is correct? PICK ONE OF THE CHOICES A thread not supporting interruption can be interrupted by another thread without issues Lock objects do not have an advantage over implicit locks, such as synchronized. Immutable Objects cannot be corrupted by multiple threads Two threads can be joined at any time.

Solution

Immutable objects cannot be corrupted by multiple threads .

a java object is said to be immutable when its state cannot be changed after the object has been created . this strategy is used for creating simple and reliable codes. immutable objects are usefull in concurrent applications and since they cannot change their state after creation they cannot be corrupted by threads. examples of immutable objects are java.lang.String as strings are immutable objects we have to create new objects in order to make changes so if a thread or multiple threads try to change or interfer then it is not possible with immutable objects. To create objects mutable we should make the class and its members final so that once the object is created no thread can modify it .

 Which JAVA statement is correct? PICK ONE OF THE CHOICES A thread not supporting interruption can be interrupted by another thread without issues Lock objects

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site