Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
    Bookmark Topic Watch Topic
  • New Topic

Can anybody answer these questions?  RSS feed

 
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?
 
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
 
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.
 
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.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Do you pee on your compost? Does this tiny ad?
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!