Harikrishna Gorrepati wrote:If we synchronize on any method in a class, we will get lock on whole object know ?? Why should we synchronize 2 methods ?
Ankit Garg wrote:
(Beaten by just 2 seconds )
rohan yadav wrote:So ankit i didnt undestand how to use command like javac -d ../classes com/myClass.java.
I using eclipse previously, so i havnt learned these concepts.
Ankit Garg wrote:You can follow a tutorial like the following
http://www.ibm.com/developerworks/java/library/j-classpath-windows/
http://mindprod.com/jgloss/classpath.html
Soumil Shah wrote:
Oops, I guess i had typed it wrong; instead of String literal pool, i written string buffer.Punit Singh wrote:Even Soumil Shah is also not clear, see his answer, he is creating an object on the buffer pool. While objects are always created on the heap.
Ankur kothari wrote:hey but can we access the objref referecne outside the if loop? doesnt being able to acess the variable and scope be the same thing?
or do you mean variables are stored only in the stacks with the methods they are in and stay there until the method gets over...or returns
Ankur kothari wrote:this invisible objects topic confused me....the topic above it said that when the method returns it goes out of scope and object can be gc
in invisible objects topic it said that the object will be weakly held even after the block finishes...what is weak and string doing here?
can someone please clear my doubt