[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

JAVA Programming :: Basic Concepts - Discussion

Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion

20 / 64

Choose the correct option.

Which keyword when applied on a method indicates that only one thread should execute the method at a time. Select the one correct answer.

Atransient

Bvolatile

Csynchronized

Dnative

Estatic

Answer: Option (Login/Signup)

Show Explanation

If multiple threads are trying to operate simultaneously on the same java object, then there may be a chance of Data Inconsistency Problem.

To overcome this problem, we should go for synchronized keyword.

If a method or block is declared as synchronized  then at a time only one thread is allowed to execute that method or block on the given object, so that Data Inconsistency problem will be resolved.  

Asked In :: Virtusa

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here