Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

chapter 5 Review Question #1

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question says What modifiers are implicitly applied to all interface methods ? (choose all that apply)
A.protected
B.public
C.static
D.void
E.abstract
F.default

Answer says only option B .

Why not E ? I wrote program with interface method excluding abstract it compiled fine . So shouldn't answer be B,E ?
 
Ranch Hand
Posts: 84
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Veena Pointi wrote:Question says What modifiers are implicitly applied to all interface methods ? (choose all that apply)
A.protected
B.public
C.static
D.void
E.abstract
F.default

Answer says only option B .

Why not E ? I wrote program with interface method excluding abstract it compiled fine . So shouldn't answer be B,E ?

because interface contain static, default, and abstract methods so all methods have a comman modifier that is public so B is correct, E is not correct because abstract is not applied to static method because it has body, but abstract methods has no body also default method has body, abstract cannot apply to this methods
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic