package com.sudhirtheindian2.java123;
import java.util.Scanner;
public class array_class {
public static void main(String[] args) {
//
// How to use and print element of an array in java
// What is array ?
// Array is an object in java which contains similar type of data
// in contiguous memory location
// 1 array index starts with 0
// types of array
// 1D array
// 2Darray
// for programmer
// int[] a= {4,5,6,9,3};
//
// for (int c:a){
// System.out.print(c+" ");
// }
// and
// for user
int[] a = new int[5];
System.out.println("enter your array element");
Scanner scanner = new Scanner(System.in);
for(int i =0;i<5;i++){
a[i]= scanner.nextInt();
}
System.out.println("your printed array is : ");
for (int d:a){
System.out.print(d+" ");
}
}
}
Computer Storage Units Converter Computer Storage Units Converter From: Bytes Kilobytes Megabytes Gigabytes Terabytes Value: To: Bytes Kilobytes Megabytes Gigabytes Terabytes Convert
टिप्पणियाँ
एक टिप्पणी भेजें