Bookmark Topic Watch Topic
  • New Topic

Can anybody answer these questions?  RSS feed

 
lAmit Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Questions:



1. Why interfaces methods cannot be decleared as protected?

2. Why overridden methods cannot be more restrictive than super class method (Assess specifier)?

3. Why overridden method cannot throw broader exception than superclass method exception?

4. Why it is not possible to change return type of overridden method ?

5. Why abstract classes are faster than interface?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please check your Private Messages for an important administrative matter.
 
lAmit Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Its done
 
Sha Jar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Report post to moderator
lAmit Joshi wrote:
5. Why abstract classes are faster than interface?


It's because abstract class methos are found faster in an object at runtime than interface methods.
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't ask the same question in different forums.

Also, please use a meaningful subject line while asking questions.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!