Why sleep()is in Thread and wait() in Object class? Why can't I have both in one class or vice versa?
1 6113This 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 6187what 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 5999how a marker interface gets its functionality and when we implements a marker interface how it got invoked
3 11964how to handle a singleton service locator. when multiple threads are trying to get the singleton object in same time
4 11235Every 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 4909There 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 6367Is it possible to create object with out its default constructor? if possible how? else not possible? justify
5 8258
Difference between this() and super() ?
What is the syntax and characteristics of a lambda expression?
Can abstract class have private constructor?
What are some characteristics of interference class?
Why string is immutable with example?
What is the abstract class?
what is anonymous class in java?
Does anyone still use java?
public class Test { public static void main(String[] args) { int countA = 0; int countB = 0; int countC = 0; int countD = 0; int countE = 0; int countF = 0; int countG = 0; int countH = 0; int countI = 0; int countJ = 0; int countK = 0; int countL = 0; int countM = 0; int countN = 0; int countO = 0; int countP = 0; int countQ = 0; int countR = 0; int countS = 0; int countT = 0; int countU = 0; int countV = 0; int countW = 0; int countX = 0; int countY = 0; int countZ = 0; } } Can anybody tell me any alternate solution(like loop or something) to automate this initialization process. Ex:- for(char chr='A';chr<='Z'; chr++) { (int) String "count"+chr = 0; }
What is called module?
What is default constructors?
What is an infinite loop? How infinite loop is declared?
What are the different types of sorting in java?
Why java strings are immutable in nature?
What is java jit compilers?