This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes why interface methods cannot be declared as native or synchronized? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "why interface methods cannot be declared as native or synchronized?" Watch "why interface methods cannot be declared as native or synchronized?" New topic
Author

why interface methods cannot be declared as native or synchronized?

michael wang
Ranch Hand

Joined: Feb 06, 2002
Posts: 35
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?


--<br />a java beginner from China
Macon Pegram
Greenhorn

Joined: Mar 01, 2002
Posts: 12
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

Joined: Aug 26, 2001
Posts: 7610
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


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Macon Pegram
Greenhorn

Joined: Mar 01, 2002
Posts: 12
You beat me to it Vallentin! I was just getting ready to post that exact same comment!
Macon
 
Don't get me started about those stupid light bulbs.
 
subject: why interface methods cannot be declared as native or synchronized?
 
Similar Threads
synchronized declarration of the random() method in Math class
Marcus Question Bank id:249
on interfaces..
Abstract methods cannot be final!!!!Really??
An abstract method can NOT be declared static, synchronized,