wat is class level lock and object level lock
Answer Posted / sitaram
class StringSample{
static void method1(){
System.out.println("classlevel...");
}
void method2(){
System.out.println("object level...");
}
}
public class StringDemo{
public static void main(String[] args) {
StringSample.method1(); // class level
// StringSample.method2(); //error
StringSample s2 = new StringSample();
s2.method2(); //object level
}
}
| Is This Answer Correct ? | 8 Yes | 18 No |
Post New Answer View All Answers
What is the purpose of return statement?
What is externalizable interface?
what is thread? : Java thread
What is meant by 'bit masking' in java?
Can we execute a program without main() method?
What is api data?
how can you take care of mutual exclusion using java threads? : Java thread
What is difference between float and double?
When will we prefer to use set and list in java and why?
Garbage collection in java?
how to deploy apache tomcat server to weblogic server in java
Where will it be used?
Can we have multiple public classes in a java source file?
What is command line used for?
What does int argc char * argv [] mean?