Java Arrays

Java Arrays In Hindi – Arrays In Hindi

Java

Java Arrays In HindiArray In Hind in Java – Array Ka Ek Different Type Ka Variable Hain Jo Different Values ( Items ) Ko Store Kar Sakta Hain | Dusre Word Main Kahe to Array Ek Special Type Ka Variable Hai Jisme Different Variables Ho Sakte Hain | Arrays Ek Same Data Type Ke Bahut Sare Values Ko Store Kar Sakta Hain Ek Sath |

Java Arrays In Hindi

Array ye same data type ke variables ka collection Hota Hain
Java Array in Hindi ko samanjh ne ke liye ham examples ko dekhte hai.

Array ko isliye istemal karte hai agar kisi ek student ka sab data stored karna ho to keval ham array ki help se keval ek hi variable banayenge.

Java Main Array Ko Create Karne Ke Liye square brackets: Ka Istemal Kiya Jata Hain |

For Example:-

String [] stu = {"Danish", "BCA", "Good Education", "Bangalore"};
  • Array ka data type koi sa bhi ho sakta hai.
  • Array ke variables Aapne pass wale memory location par stored Hota hai.
  • Array ka pahla value 0 se start hota hai.
  • Array Ka Pahla Memory Address Sabse Kam Hota hai.

Types Of Array in Java in Hindi

  • One Dimensional Array
  • Two & Multi-Dimensional Array

One Dimensional Array in Java In Hindi

PHP 1-D Array Number 0 Se Start Hote Hain And Ham Java 1-D Array Main Number, String, object Ko Store Kar Sakte Hain | Ye Sabhi Items 1-D Array Main Alag Alag Index Number Ke Sath Hote Hain |

Memory Representation

Example :

String [] stu = {"Danish", "BCA", "Good Education", "Bangalore"};
System.out.println(stu[0]);

Output:

Danish

Aap Array Ke Index Number Ko Istemal karke Uska Value Bhi Change Kar Sakte Hai Jaise Ki Aapko Niche Diye Gaye Example 2 Me Dikhaya Gaya Hai |

Example 2:

String [] stu = {"Danish", "BCA", "Good Education", "Bangalore"};
stu[1] = "BTech"
System.out.println(stu[1]);

Output:

BTech

Agar Hame Array Ki Length Bhi Pata Karni Hoto Ham length Function Ka Istemal Karenge And Niche Diye Gaye Example 3 Me Is Output Dikhaya Gaya Hai |

Also Read – Java Strings

Example 3:

String [] stu = {"Danish", "BCA", "Good Education", "Bangalore"};
System.out.println(stu.length);

Output:

4

Agar Aapko Array Ke All Elements Ko Print Karna Hai To Aap For Loop Ka Istemal kar Sakte Hai. Jaise Ki Niche Diye Example 4 Me Dikhaya Gaya Hai |

Example 4:

String [] stu = {"Danish", "BCA", "Good Education", "Bangalore"};
for(int i=0; i<stu.length; i++)
{
  System.out.println(stu[i]);
}

Two Dimensional Array in Java In Hindi

Java Arrays Jisme Sirf 2 ya 2 se jyada Subscript Hoti Hai | Use Two Ya Multi Dimensional Arrays Kahte Hai | Iska Pryog Matrix Ya Table Ke Rup Mai Hota Hai |

Memory Representation

array in c Hindi

Syntax:

data_type[] array_name[ row_size ][ column_size ];

Example Syntax:

int[][] myNum = { {1, 2, 3, 4}, {5, 6, 7} };

Example 1:

public class MyClass {
  public static void main(String[] args) {
    int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7} };
    for (int i = 0; i < myNumbers.length; ++i) {
      for(int j = 0; j < myNumbers[i].length; ++j) {
        System.out.println(myNumbers[i][j]);
      }
    }
  }
}

Output:

1
2
3
4
5
6
7

Also Read This Post:

Dosto mujhe ummed hai ki aap Array in Java in Hindi  ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre |

Leave a Reply

Your email address will not be published. Required fields are marked *