This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

abstract Interface  RSS feed

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how a interface can be abstract???see the javax.ejb package and there is an interface like that
public abstract interface EJBObject
extends java.rmi.Remote
can any one explain what does it mean
Aamir
[This message has been edited by Aamir Khan (edited November 07, 2000).]
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The signature for EJBObject is just
public interface EJBObject extends java.rmi.Remote.
Please check this site http://java.sun.com/j2ee/j2sdkee/techdocs/api/javax/ejb/EJBObject.html.

Chitra
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An abstract class is one which can not be created, but must be extended first. An abstract interface is one which can not nbe implemented, but must be extended first. Consider the following example:
 
Aamir Khan
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frank , I got it now.
Aamir
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank, Sorry to say that you are worng.
Look at this program
abstract interface B{
public void doB();
}
interface C{
public void doC();
}
public class A implements B,C{
public void doB(){
System.out.println("I am B");
}
public void doC(){
System.out.println("I am C");
}
public static void main(String arg[]){
A ob = new A();
ob.doB();
ob.doC();
}
}
This program works perfectly fine.
As per the java language specs 9.1.2.1
Every interface is implicitly abstract and this modifier is
obsolete and should not be used in new Java programs.
I executed the above example using jdk1.2
Thanks,
Naveen.
 
Police line, do not cross. Well, this tiny ad can go through:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!