What is right to way to declare array of primitives?

What is right to way to declare array of primitives?

type var-name[];
OR
type[] var-name;

// both are valid declarations
int intArray[];
or int[] intArray;

byte byteArray[];
short shortsArray[];
boolean booleanArray[];
long longArray[];
float floatArray[];
double doubleArray[];
char charArray[];

int[] intArray = new int[30];
int[] intArray = new int[]{ 1,2,3,4,5,6,7};


By:
Date:0000-00-00 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher