Array is a collection of similar type of element.
syntax while declaring array in java
public class JavaStringArrayTests
{
private String[] toppings = new String[20];
// more to the class here ...
}
import java.util.*; public class array{ public static void main(String[] args){ int num1[] = {1,2,45,82,25,63}; int l = num.length; int i,j,t; System.out.print("number : "); for (i = 0;i < l;i++ ){ System.out.print(" " + num[i]); } } }
Aryantech.in,Pune

No comments:
Post a Comment