• 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

question about interfaces

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look to this question from Dan's mock:
interface A {void main(String[] args);} // 1
interface B {public void main(String[] args);} // 2
interface C {public static void main(String[] args);} // 3
interface D {protected void main(String[] args);} // 4
interface E {private void main(String[] args);} // 5

Which interface declarations generate a compile-time error?
a. 1
b. 2
c. 3
d. 4
e. 5
f. None of the above
the answer is c,d,e.
why c is an answer?
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All the method declarations in an Interface are implicitly public and abstract. A method cannot be abstract and static.
reply
    Bookmark Topic Watch Topic
  • New Topic