Student Details

5 comments - Post a comment

/* 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();
}
}

 
This Post has 5 Comments Add your own!
Anonymous - July 2, 2012 at 5:42 PM

thank you very much.you are doing wonderful job.go ahead

Geetha - July 13, 2012 at 6:30 PM

if i wanna declare variable in private????

aishu1990 - July 22, 2012 at 8:58 PM

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???

Anonymous - July 22, 2012 at 8:59 PM

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at det.main(det.java:24)
what is this error means??
can anyone explain this???

Anonymous - July 22, 2012 at 8:59 PM

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at det.main(det.java:24)
while executing am getting this error..what it means?

Post a Comment