• 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

interfaces

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This is from the Abhillaash Quiz
Question 26.
public XXXX extends something1, something2

1.XXX should be an interface,something1 and something2 need not, for the expression to be legal
2.XXX should be a class, something1 and something2 must be interfaces for the expression to be legal.
3.XXX, something1 and something2 must be interfaces for the expression to be legal.
4.The above statement is alway illegal in Java as multiple inheritance is not supported.
The answer given is 3, But I doubt it is wrong...
Any explainations ?
Thx
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java Language Specification (version 1) 9.1.3
says that is the correct declaration for an interface
that extends multiple interface types. In other words, an
interface can have multiple superinterfaces.
Bill
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a class cant extend multiple classes but an interface can extend multiple interfaces ...
manal ...
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys Let me know The URL for the Abhillash Quiz.
I am preparing a resource for MOCK exams.
If anybody can help me with this.
Regards
Tushar Kansara
------------------
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

After a lot of digging into the past......
here it is. I am surprised this is not in the Javaranch mock exam list.
Hope this helps.
Regds.
- satya
reply
    Bookmark Topic Watch Topic
  • New Topic