Clean Java

There is always a bigger game

Array declaration in java.

leave a comment »


package org.sanju.lang;

/**
 * @author sanju.org
 * @date 31st July, 2011
 * 
 * How to declare arrays in java?
 * Array declaration in java
 *
 */

public class StringArrayExample {

	public static void main(String args[]){
		
		//if you know the size of the array in advance
		Object [] array = new Object[8];
		//anonymous declaration of array
		String [] stringArray = new String[]{"clean", "java"};				
	}
}

Advertisements

Written by cleanjava

August 1, 2011 at 10:11 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: