This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

some questions

 
atif imran
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)when we use refference of any object why
toString()call automatically?
2)What is inlining for final method.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) All objects inherit from class Object. It has a toString() method.
2)If a method is final, then it can not be overriden. That means that at compile time the compiler KNOWS what is going to happen and can therefore do some stuff to make it more efficient. One of the things that it can do if it KNOWS what the method will return - always, then it can replace the call to the method with just the value that that method will return - also known as "inlining" (meaning that you don't have to go off to the method to find the answer).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic