system.out.println("marks are:"+e1.getMarks());
Your
getMarks()
method returns an array, rather than something that is printable. The default implementation of an array's
toString()
method just prints the address of the array. You need to add a method that prints the individual members of the array.