we have two threads..both the threads are reading the
data.. is there any need of synchronization
there?...justify it?
Answer Posted / ranjan
synchronization is necessary in threads
problem.synchronization means at a time only one thread can
access it.If it is not done then one thread will read the
resource & other will try to update it.It will create a
problem.
| Is This Answer Correct ? | 3 Yes | 11 No |
Post New Answer View All Answers
What do negative exponents mean?
What is meant by tab pans?
what is collatration?
Can variables be used in java without initialization?
What is starvation?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
Is minecraft java edition free?
Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2)
What are the different http methods?
What are singleton services?
What is a null point?
How can we find the actual size of an object on the heap?
How objects of a class are created if no constructor is defined in the class?
How many times finalize method will be invoked? Who invokes finalize() method in java?
Which package is imported by default?