class
students
{
private int sno;
private String sname;
public void setstud(int no,String name)
{
sno = no;
sname = name;
}
public void dispstud()
{
System.out.println("Student No : " + sno);
System.out.println("Student Name :" + sname);
}
public static void main(String args[])
{
if(args.length < 2)
{
System.out.println("Invalid Arguments");
System.exit(0);
}
students s = new students();
int no =
Integer.parseInt(args[0]);
String name = args[1];
s.setstud(no,name);
s.dispstud();
}
}
Read More »
Tags:
java programs