Win a copy of Mesos in Action this week in the Cloud/Virtualizaton 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