光大银行总行部门待遇:nullpointerException

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/08 15:01:01
public class Alone6_2
{
private int a,b;
public Alone6_2()
{

}
public void setAB(int a,int b)
{
this.a=a;
this.b=b;
}
public int getA()
{
return a;
}
public int getB()
{
return b;
}
public static void main(String args[])
{

Alone6_2 ob[]=new Alone6_2[10];

ob[0].setAB(1,2);
System.out.println("ob[0].a="+ob[0].a+",ob[0].b="+ob[0].b);
for(int i=0;i<=9;i++)
{
ob[i+1].a=ob[i+1].a+ob[i+1].b;
ob[i+1].b=ob[i+1].a*ob[i+1].b;
System.out.println("ob["+(i+1)+"].a="+ob[i+1].getA()+",ob["+(i+1)+"].b="+ob[i+1].getB());
}
}
}

帮我看看老是出现上面的问题!

评论 ┆ 举报

最佳答案此答案由提问者自己选择,并不代表百度知道知识人的观点

回答:wjg5256
智者
9月28日 00:24 type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:346)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

root cause

java.lang.NullPointerException
org.apache.jsp.liuyanben.ly_jsp._jspService(ly_jsp.java:75)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

揪错 ┆ 评论 ┆ 举报