/* Simple Java Program For Displaying Name, Roll no. MArks and total of a student*/
class stud
{
public static float tot;
public static int rno;
public static String name;
public static int m1,m2,m3;
public void calc()
{
tot=(m1+m2+m3)/3;
}
public void op()
{
System.out.println("rollno="+rno);
System.out.println("name="+name);
System.out.println("%="+tot);
}
public static void main(String args[])
{
stud s=new stud();
rno=Integer.parseInt(args[0]);
name=args[1];
m1=Integer.parseInt(args[2]);
m2=Integer.parseInt(args[3]);
m3=Integer.parseInt(args[4]);
s.calc();
s.op();
}
}
Labels: Core Java
Subscribe to:
Post Comments (Atom)
thank you very much.you are doing wonderful job.go ahead
if i wanna declare variable in private????
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at det.main(det.java:24)
what is error means?
can anyone explain this??
Dont know how to rectify and where the error is??
can anyone help???
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at det.main(det.java:24)
what is this error means??
can anyone explain this???
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at det.main(det.java:24)
while executing am getting this error..what it means?