wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes interface and abstract methods. 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 "interface and abstract methods." Watch "interface and abstract methods." New topic
Author

interface and abstract methods.

SaiPrasad Jukalkar
Ranch Hand

Joined: Feb 20, 2001
Posts: 79
On JWhiz Labs Tips page the 16th Tip says
-----Interface methods can't be native, static, synchronized, final, private, protected or abstract. ------
but when i compile this code it compiles without giving any errors.
interface xy{
abstract void xymethod();
}
pl. kindly clear my doubts.


JSP
Arpana Rai
Ranch Hand

Joined: Nov 12, 2002
Posts: 93
Originally posted by SaiPrasad Jukalkar:
On JWhiz Labs Tips page the 16th Tip says
-----Interface methods can't be native, static, synchronized, final, private, protected or abstract. ------
but when i compile this code it compiles without giving any errors.
interface xy{
abstract void xymethod();
}
pl. kindly clear my doubts.

Interface methods are implicitly public and abstract.so it is not a good practise to declare them abstract expilicitly though it will not give any kind of error.
regds
Arpana


SCJP1.4(91%)
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

As Aparna rightly pointed out, they are implicitly public and abstract. And it is incorrect to say that they can't be abstract.
- Manish
Siva Sivaraman
Greenhorn

Joined: Sep 26, 2002
Posts: 17
Select the valid modifiers for Interface methods
1.abstract
2.native
3.volatile
Is this an ambiguous question?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interface and abstract methods.
 
Similar Threads
Abstract interface!!!????
can interface have abstract methods
Implementing abstract/interface method as static
abstract class and Interface
confusion with abstract