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 an object in java and how is it created?
How can we achieve thread safety in java?
How does map works in java?
What is wrapper class html?
Define inheritance with reference to java.
What is the numeric promotion?
What is null statement?
What is an empirical question?
List the different types of classloaders in java.
What is the r character?
write a program that list all permutations of ABCDEF in which A appears before B?
What are desktop procedures?
Is there any way to find whether software installed in the
system is registered by just providing the .exe file?
I have tried the following code but its just displaying the
directory structure in the registry.
Here the code :
package com.msi.intaller;
import java.util.Iterator;
import ca.beq.util.win32.registry.RegistryKey;
import ca.beq.util.win32.registry.RootKey;
public class RegistryFinder {
public static void main(String... args) throws Exception
{
RegistryKey.initialize(RegistryFinder.class.getResource("jRe
gistryKey.dll").getFile());
RegistryKey key = new RegistryKey(RootKey.HKLM,
"Software\\ODBC");
for (Iterator
What is return used for in java?
What is an object class?