Array as parameters

Hope you already gone thru basic of arrays.
An array can be sent as parameter to a constructor or a method. Also an array can be returned by a method.
Below example shows the same.

class Student{
	int marks[];
	Student(int m[])
		marks = m;
	private int getTotal(){
		int sum = 0;
		for(int i=0;i

Below is an example showing a method returning an array.

public class StudentProgram {
	public static void main(String arg[])
		int gmp[] = getArray();
		for(int item:gmp)
	private static int[] getArray()
		int smp[] = {45,64,53,26};
		return smp;

You may also like to read:
array example
how to sort an array in java