where the static methods will live ,on stack ? can you
explain brefly
Answer / suman rani
As you know static variable directly belongs to the class, so it is be stored in heap area where all the byte code of class are stored.That area is also called permanent code segment area.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain scope or life time of local variables in java?
If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
What is the difference between yield() and sleep()?
Is static variable stored in heap?
Which eclipse is best for java?
explain oops concepts with examples?
29 Answers AbhiBus, Beeline, DELL, HCL, Satyam, TCS, VLS, Wipro,
what is domain object
how to prepare for IT Officers Interview in Banks
0 Answers TATA, Tata Steel Limited,
Name component subclasses that support painting in java programming?
When is the finalize() called?
Why Java is a platform independent language?