看了网上的相关资料,写了一个接口继承的程序,其中一段:继承接口Prompts<%@ page import="com.businessobjects.rebean.wi.Prompt" %>
<%@ page import="com.businessobjects.rebean.wi.Prompts" %>
...
<% public class myPrompts implements Prompts
{
public Prompt getItem(String s){}
public Prompt getItem(int i){}
public int getCount(){}
} %>
说明:getItem(String s),getItem(int i),getCount()三个方法是Prompts有的myPrompts位置报错:Illegal modifier for the local class myPrompts; only abstract or final is
permitted
<%@ page import="com.businessobjects.rebean.wi.Prompts" %>
...
<% public class myPrompts implements Prompts
{
public Prompt getItem(String s){}
public Prompt getItem(int i){}
public int getCount(){}
} %>
说明:getItem(String s),getItem(int i),getCount()三个方法是Prompts有的myPrompts位置报错:Illegal modifier for the local class myPrompts; only abstract or final is
permitted
public Prompt getItem(String s){}
public Prompt getItem(int i){}
public int getCount(){} 如果不实现你也得在有返回类型的反法里来一句:return null;
你实现了接口Prompts中的所有方法吗?getItem(String s),getItem(int i),getCount()三个方法是Prompts接口中仅有的3个方法吗?
getItem(String s),getItem(int i),getCount()是Prompts接口中仅有的3个方法
加了“return null;”,报同样错误
不能用 return null用 return 1
public Prompt getItem(String s);
public Prompt getItem(int i) ;
public int getCount();
}