Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Java
« Previous
Next »
To execute the threads one after another
Options
- the keyword synchronize is used
- the keyword synchronizable is used
- the keyword synchronized is used
- None of the above
CORRECT ANSWER : the keyword synchronized is used
Discussion Board
english
hiii
saniya 08-17-2021 11:25 PM
misleading question caption
I suggest that in the view of a test the caption "To execute the threads one after another" is misleading as:
a) a thread cannot be "executed";
b) in context of synchronized the correct caption would be "What provides data consistency when multiple threads are running?".
Andrew Frolov 09-5-2016 10:11 AM
java
java is an interesting
Gebreslassie Taddesse 08-20-2015 08:23 AM
Execution of threads
Synchronized methods are used to execute threads one after another in synchronized manner. As they enable threads to interfere with each other and allow the memory to function properly without showing any consistency errors. Synchronized method ensures that if an object is visible to more than one thread, all reads or writes to that object's variables are done in synchronized manner. Whenever a synchronized method exits from the function or working then it automatically creates a happens-before relationship with any subsequent invocation of a synchronized method for the same object. This way the change in state becomes visible to all the threads.
Rohit Sharma 07-26-2014 07:19 PM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲