Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?
1 6023This is related to threads. I have a class with synchronized method m1(). Can I create different instances of this class and execute the m1() for different threads?
3 6074what is the output??????? public class multireturn { public(int assign x ( int x) { if(4==x) { return 7; } else if (7=x+3) { return 6; } return 5; } }
TCS,
3 5881how a marker interface gets its functionality and when we implements a marker interface how it got invoked
3 11798how to handle a singleton service locator. when multiple threads are trying to get the singleton object in same time
4 11082Every class extends object but why it is not possible for every object to invoke clone() method. ideally protected methods should be accessible from sub classes. isn't it?
2 4792There are 2 different ways to create an object. a)By using keyword "new" b)By using Class.forName ("className").newInstance(); What is the difference between these 2 methods.
3 6257Is it possible to create object with out its default constructor? if possible how? else not possible? justify
5 8021
What is e java?
Explain the selection sort algorithm and state its time complexity?
Java.util.regex consists of which classes?
What do you mean by formatting?
What is the purpose of interface?
How many decimal places is a double?
How to change the priority of thread or how to set the priority of thread?
Why main method is static in java?
What is an object's lock and which object's have locks in java programming?
What is constructor and virtual function? Can we call a virtual function in a constructor?
Is a copy constructor?
Why java is used everywhere?
Can java list be null?
What is a default constructor and also define copy contrucyor?
what is abstract class in Java?