为了账号安全,请及时绑定邮箱和手机立即绑定

SuperAction类中修饰接口引用为什么要使用protected不用private

public class SupperAction extends ActionSupport implements ServletRequestAware,

ServletResponseAware, ServletContextAware {


private static final long serialVersionUID = 1L;

protected ServletContext context;

protected HttpServletResponse respose;

protected HttpServletRequest request;

protected HttpSession session;

正如上面这些代码所示,使用protected修饰HttpServletResponse ,HttpServletRequest,HttpServletRequest, HttpSession 接口引用为受保护属性,把这几个接口类的引用设为private(

private HttpServletResponse ;

private HttpServletRequest;

private HttpServletRequest;

private HttpSession;

)的时候,编译器会显示警告,为什么这里属性不能设为private?

正在回答

举报

0/150
提交
取消

SuperAction类中修饰接口引用为什么要使用protected不用private

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信