Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why interface methods cannot be declared as native or synchronized?

 
michael wang
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know that interface method cannot be declared as abstract,but i don'e know why interface methods cannot be declared as native or synchronized?
 
Macon Pegram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interface methods merely describe a contract that an implementing class must fufill. They do not describe in any way the implementation details.
native and synchronized refer to implementation details that are not only not known, but also not relevant when specifying an interface.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also refer the following yesterday's discussion about the topic:
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=015080
 
Macon Pegram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You beat me to it Vallentin! I was just getting ready to post that exact same comment!
Macon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic