• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Sybex Java OCA 8 Online Bonus Test Typo Question 103 of 180

 
Ranch Foreman
Posts: 142
8
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sybex Java OCA 8 Online Bonus Test Typo Question 103 of 180
public abstract class Albatross {
abstract Long fly();
}

B. protected void fly(int height)

Option B is correct—it is an overloaded method, not an overridden one—so the access modifier change from public to protected is allowed.

It should be access modifier change from DEFAULT to protected is allowed. The method in Albatross class is default,not public.
by alinvlad05
 
Bartender
Posts: 1737
63
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, many similar questions implement an interface, so the "default" in the interface is to "public", and an override must be public as well -- but that is not the case in this question.
 
author & internet detective
Posts: 41147
848
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agreed! This is an abstract class, not an interface. I've added this to the errata.

I checked the Java 11 bonus exam and it does not contain this question.
 
reply
    Bookmark Topic Watch Topic
  • New Topic