If two threads call a static method at the same point of
time, what will happen?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is a void return type?
Why main method is static in java?
What happens when a thrown exception is not handled?
What is diffrance between FINALIZE() & FINALLY ?
Can we extend immutable class?
Why do we need public static void main(String args[]) method in Java...?
what is the difference between multitasking and multithreading?
What is a method declaration?
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"); } }
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.
What is the difference between a method and a procedure?