answersLogoWhite

0


Best Answer

synchronized

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which keyword when applied on a method indicates that only one thread should execute the method at a time?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is an access specifier?

An access specifier is a keyword applied to a variable, or method, which indicates which parts of the program are permitted to access it.


The keyword indicates that a method does not return a value?

void


Why do you use static key word in Java programming?

Static is a keyword,when u execute a method in class file loaded, execute the first this method..


Native method in java?

The native modifier indicates that a method is implemented in platform-dependent code (Not Java Of Course), but often in C. The native keyword can be applied only to methods-not classes, not variables, just methods. Note that a native method's body must be a semicolon (;) (like abstract methods), indicating that the implementation is omitted


What is the difference between throw and throws in net?

"throw" is the keyword to raise an exception. "throws" is a Java keyword that indicates a specific method can potentially raise a named exception. There is no analog in VB.Net or C#. Perhaps there is a "throws" keyword in J#?


What if a final keyword is applied to a function?

The final keyword in JAVA means that the class can no longer be derived, i.e. it cannot be used as a base class for a new child class.If you declare a method as final, this method cannot be overridden in any of the child class that may extend this class.


Can you declears static in a local variable in a method in java?

we cannot use the staic keyword inside the method... But we can use the final keyword inside the method....


What is the meaning of java void keyword?

The void keyword is used to show that a method will not return a value. // no return type public void setX(int x) { this.x = x; } // returns an int public int getX() { return x; }


When wil you need throws keyword in java?

The throws keyword will be used in method declaration to signify the fact that, some pieces of code inside the method may throw exceptions that are specified in the method signature.


Why don't use abstract keyword when we declare a method in interface?

The abstract keyword signifies that the particular method will have no features in the class where it is declared and it is upto the child class to provide the functionality. In case of an interface, the method is already abstract by default and has no code inside it. So there is no actual point in using the abstract keyword there.


What is void main?

The main method is the first method, which the Java Virtual Machine executes. When you execute a class with the Java interpreter, the runtime system starts by calling the class's main() method. Themain() method then calls all the other methods required to run your application. It can be said that the main method is the entry point in the Java program and java program can't run without this method.The signature of main() method looks like this:public static void main(String args[])The method signature for the main() method contains three modifiers:public indicates that the main() method can be called by any object.static indicates that the main() method is a class method.void indicates that the main() method has no return value.


What is the final keyword in Java?

The final keyword precedes a declared constant which after Instantiation cannot be modified. Examples. final double PI = 3.14; PI = 1234; // does not compile //or final double ONE; ONE = 1; // Instantiated ONE = 2; // does not compile ---------------------------------------- final keyword can also apply to a method or a class. When applied to a method - it means the method cannot be over-ridden. Specially useful when a method assigns a state that should not be changed in the classes that inherit it, and should use it as it is (not change the method behaviour). When applied to a class it means that the class cannot be instantiated. A common use is for a class that only allows static methods as entry points or static final constants - to be accessed without a class instance. A good example is Java's: public final class Math extends Object