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
difference between byte stream class and character stream class?
What are the differences between c++ and java?
What is difference overloading and overriding?
Why char array is favored over string for the storage of passwords?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
What is Major and importance difference between for and foreach loop ?
What does @param args mean in java?
What’s the difference between unit, integration and functional testing?
What is thread safe singleton?
Explain runtime exceptions?
What is the purpose of methodology?
How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?
What is valid keyword in java?
How many ways can we create singleton class?
Explain about map interface in java?