Why we use static and synchronized in method for single
thread model
example:
public static synchronized add(){}

Answer Posted / sameer

Ststic means it belongs to class.When u call a syncronized
method u keep the luck of that class.

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to perform linear search in java?

578


Why do we need autoboxing in java?

533


Should you use singleton pattern?

534


Detail discussions on JVM, memory management and garbage collector.

562


What is a methodologist?

538






Explain about instanceof operator in java?

624


What is the use of math abs in java?

558


Differentiate between postfix and prefix operators in java.

652


What is the largest long allowed by java?

547


In java, how many ways you can take input from the console?

530


How do you use wildcards?

546


What is Enum in Java?

694


What is the maximum size of array in java?

532


Differentiate between the constructors and methods in java?

513


What is sizeof () operator?

578