• 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

What does it means?

 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question from Dan Chisholm

Which of the following statements are true?
a. A final method can not be overridden.
b. All methods declared in a final class are implicitly final.
c. The methods declared in a final class must be explicitly declared final or a compile-time error occurs.
d. It is a compile-time error if a private method is declared final.
e. A machine-code generator can inline the body of a final method.

Can any body please explain What does the last last (e) line says?
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a method is final and is relatively simple, then a compiler could choose to replace all the method calls by the code in the method body. In some cases this can speed up the program when it is run. The downside is that the program can get bigger in size.
 
Sanjeev Singh
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Barry,
I never heard of this thing,thanks for a nice explanation.
reply
    Bookmark Topic Watch Topic
  • New Topic