Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

OCA 1Z0-808 Chapter 4 Mock Explanation #9 page 344 (Sybex) AND online Chapter 4 Mock Explanation #9

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Explanation to question 9 for Mock in the book mentions A, C, E are the correct answers. Shouldn't this be A, E?
  • Regarding answer A: The theory in table 4.5 on page 206 mentions: "Getter methods begin with is or get if the property is a boolean." So isn't this answer correct then?
  • Regarding answer C: The theory in table 4.5 on page 206 mentions: "The method name must have a prefix of set/get/is, followed by the first letter of the property in uppercase, followed by the rest of the property name." Since the getter method is called getNumWings and the variable is called numberWings, this doesn't follow the JavaBeans convention, right, so answer C should be incorrect?

  • The online material mentions C, E are correct. Again, shouldn't this be A, E?
     
    Bartender
    Posts: 3524
    150
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    hi Manfred,

    there have been many discussions about answer C on this forum. I myself had the exact same question. But how it works is:

    suppose you have a private field of type 'X', called 'b', and that there is a method: public X getA() {return b;};

    Then you have a property called 'A', and its value is b. I have read and re-read this part of the book, and although with hindsight the explanation is correct, many (including me) would have thought that b was the property. and the method should have been called 'getB'.

    It takes a while before you believe it and accept it, but there you go.
     
    What a stench! Central nervous system shutting down. Save yourself tiny ad!
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!