If two threads call a static method at the same point of
time, what will happen?

Answers were Sorted based on User's Feedback



If two threads call a static method at the same point of time, what will happen?..

Answer / terlis

if the method is not synchronised, two threads can acees the same method at the same time and there will be inconsistency.

Is This Answer Correct ?    9 Yes 2 No

If two threads call a static method at the same point of time, what will happen?..

Answer / ashutosh dhar

Nd if it is Synchronized then which thread to be choosen
depends upon the OS.

Is This Answer Correct ?    0 Yes 0 No

If two threads call a static method at the same point of time, what will happen?..

Answer / amitasite

If method doesn't access static member variable but only
local variable then there is no inconsistency.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is a void return type?

6 Answers  


Why main method is static in java?

0 Answers  


What happens when a thrown exception is not handled?

0 Answers   Wipro,


What is diffrance between FINALIZE() & FINALLY ?

2 Answers   Infosys,


Can we extend immutable class?

0 Answers  






Why do we need public static void main(String args[]) method in Java...?

1 Answers  


what is the difference between multitasking and multithreading?

21 Answers   TCS,


What is a method declaration?

0 Answers  


public class BatchTest { public static void main(String[] args) { Runtime run = Runtime.getRuntime(); try { Process p = run.exec("cmd start /c D:/test.bat"); System.out.println(p.exitValue()); } catch (Exception e) { e.printStackTrace(); } System.out.println("FINISHED"); } }

0 Answers  


is JVM platform dependent or independent..?

11 Answers   IBM, Tech Mahindra,


Why only one Class is public in one file? Explain in details. Thanks in Advance.

12 Answers  


What is the difference between a method and a procedure?

0 Answers  


Categories