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
Explain the use of javap tool.
Why do we need wrapper class?
What are facelets templates?
What is the difference between the final method and abstract method?
How does sublist works in java?
What is the history of java?
What is boolean logic?
what state does a thread enter when it terminates its processing? : Java thread
If you do not want your class to be inherited by any other class. What would you do?
What are the differences between graph and tree?
What is the difference between instanceof and isinstance?
Why is core java important?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
Explain the Propertie sof class?
Explain the use of sublass in a java program?