Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Java Array Declaration

                         

As we declare a variable in Java, An Array variable is declared the same way. Array variable has a type and a valid Java identifier i.e. the array's type and the array's name. By type we mean the type of elements contained in an  array. To represent the variable as an Array, we use [] notation. These two brackets are used to hold the array of a variable.

By array's name, we mean that we can give any name to the array, however it should follow the predefined conventions. Below are the examples which show how to declare an array :-

int[] array_name;     //declares an array of integers
String[] names;
int[][] matrix;    //this is an array of arrays

It is essential to assign memory to an array when we declare it. Memory is assigned to set the size of the declared array. for example:

int[] array_name = new int[5];

Here is an example that creates an array that has 5 elements.

public class Array
{
   public static void main(String[] args)
   {
      int[] a = new int[5];
   }
}

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
ajax auto complete
hybernet
Photoshop Drawing Draw
how to install tomcat
Download JDK
add picture to a swing
Flash Interactivity Sc
jsf datatree component
array element
ad
login using JSP
static commands
compare contents of fi
HWPF
objective
j2me servlet
using character to vie
hyperlink in JSF
coding of radio button
actions on menuitems
setpropertyvalue
log4j
PhotoshopTech/Abstract
Photoshop Effects Hole
html:input
PHP Database Related I
richfaces tutorial
get single character u
messagebox portlet
Java file
Jasperreports
java buffer
linux
acknowledging browser
create xml using java
â????????â???????â????
� �±�?�»�?�§
JScrollPane
MULTIPLE SELECT COMBO
birt
graphicImage
create jsp tag
ASP Database Related U
Aர�ய�ய�ர
difference between arr
Photoshop Effects Smok
Photoshop Drawing Holl
breakÑ?Ð?Ð?Ñ??Ñ?Ð????Ñ
word in stirng
list duplicates hibern
two dimensional array
i-batis
PHP Date and time func
storedprocedure in ora
Linux Caixa Mпâ? ?пâ
delete hyperlink in gr
j2me insert image usin
Introduction to jquery
cinema 4d
how create mp3 player
data binding
breaké?«ê²¯?é?«???é?«ê
PL/]SQL
storing text data to a
How to write code for
JSTL API
scroll
spring hybernate eclip
tattoo efectes
javascript to Display
message box display
inno
Flex Custom mxml tags
merging pdf
difference between com
b tree implementation
JDBC and Mysql
s:if
MySQL Server as Linked
QtJambi
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.