jQuery in Action, 2nd edition
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
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: why interface methods cannot be declared as native or synchronized?
 
Similar Threads
synchronized declarration of the random() method in Math class
on interfaces..
Marcus Question Bank id:249
Abstract methods cannot be final!!!!Really??
An abstract method can NOT be declared static, synchronized,