RahulRise Das wrote:No, i just want the exact meaning of valueOf() and toString() methods and what do they do ?
Why you don't want to use System.out.println()?
It also usually returns null if you execute a .jar file with the javaws/javaw tools. If you have a launcher for an executable .jar file and click that, it usually defaults to using javaw or javaws, and the console will be null.
Paweł Baczyński wrote: . . . Warning. This method returns null when executed using some IDEs.
… as Paweł would say.
print output without using a method that is designed to print output
RahulRise Das wrote:but now i'm trying to get the output using "return" statement.
Tapas Chand wrote:The purpose of println() method and return are completely different.
println() method is used to print something on the console.
return is used to explicitly return from a method to the caller.
Can you post your code and explain what is your requirement if I am missing something.
RahulRise Das wrote:Can you explain this line more elaborately : return is used to explicitly return from a method to the caller.
Neither. It goes back to the method which called that method. Possibly as a local variable. But does it matter whether it is on the heap or the stack?
RahulRise Das wrote: . . . where is the value returned to: Java Virtual Machine Stack or Heap ?