** as you can see I have made a program to print Student Record of same branch and college in which user inputs the name and roll number.
I have tried generating toString() from my IDE but it is still showing " [Ljava.lang.String;@4e50df2e" these...please help me get rid of this...thank You.**
class Stur
{
static String branchcode="C04";
static String branch="Computer Sc. & Eng. ";
static String rollcode="18020";
static String collegeName="Kalaniketan Polytechnic College";
String rollno[],name[];
Stur(String n[],String r[])
{
rollno=r;
name=n;
System.out.println(name+" \t "+rollcode+""+branchcode+""+rollno+" \t"+branch+""+collegeName);
}
}
class staticVar1 //main method class
{
public static void main(String ujyg[])
{
int j=0, i=0;
Scanner object=new Scanner(System.in);
System.out.println("how many Students ");
int n=object.nextInt();
String arr[]=new String [n];
for(i=0;i<arr.length;i++)
{
System.out.print("Enter roll number:");
arr[i]=object.next();
System.out.print("Enter Name:");
arr[i]=object.next();
}
System.out.println("Name \t Roll Number \t Branch \t\t College\n");
for(j=0;j<arr.length;j++)
{
Stur st=new Stur(new String[i], new String[i]);
}}
}
Expecting output like this
Name Roll Number Branch College
Anf 18020C0406 Computer Sc. & Eng. Kalaniketan Polytechnic College
xyz 18020C0402 Computer Sc. & Eng. Kalaniketan Polytechnic College
Ad 18020C0405 Computer Sc. & Eng. Kalaniketan Polytechnic College
Ax 18020C0401 Computer Sc. & Eng. Kalaniketan Polytechnic College