This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

HFSJ mock question doubt

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following is the mock question in HFSJ.

One of the options "the MyFunctions class may be used by EL even though it has a public constructor." In the book, this option is correct. The comment say "because EL ignores all instance methods, EL doesn't care that it's dealing with a concrete class"

Three things I don't understand:
1. the option itself (the part after "even though")
2. the comment for this option.
3. Still I don't know if EL can use a constructor

What do you think?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is about what kind of Java classes/methods can be used for EL functions. Here are the requirements for such functions :
  • The class specified in the TLD must be a public class, and must be specified using a fully-qualified class name (including packages).
  • The specified method must be a public static method in the specified class, and must be specified using a fully-qualified return type followed by the method name, followed by the fully-qualified argument types in parenthesis, separated by commas


  • About the things you don't understand :
  • 1. It is a mean to disturb you. You can use any public class, having a default constructor or not.
  • 2. Refer to the above requirements
  • 3. EL calls static functions, so the constructor is not used. The class is not even instantiated.

  •  
    Hey! Wanna see my flashlight? It looks like this tiny ad:
    SKIP - a book about connecting industrious people with elderly land owners
    https://coderanch.com/t/skip-book
    reply
      Bookmark Topic Watch Topic
    • New Topic