• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

some questions

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)when we use refference of any object why
toString()call automatically?
2)What is inlining for final method.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic