I don't think that i have to say what is Array as all of you have read it many times..I am staright away here with the program..So read it guys...
PROGRAM:-
public class Demo
{
public static void main(String args[])
{
int []mark=new int[3];
mark[0]=1;
mark[1]=2;
mark[2]=3;
System.out.println(mark[1]);
}
}
Output:-
2
Note:- The word new written in blue color in above program is used to create Array in a java program..
Hope you got it...
PROGRAM:-
public class Demo
{
public static void main(String args[])
{
int []mark=new int[3];
mark[0]=1;
mark[1]=2;
mark[2]=3;
System.out.println(mark[1]);
}
}
Output:-
2
Note:- The word new written in blue color in above program is used to create Array in a java program..
Hope you got it...
No comments:
Post a Comment