Posts

Showing posts with the label 1d vs 2d

Array in Java – Types, Syntax & Examples जावा में ऐरे

In Java, an array is a collection of similar data types stored in contiguous memory locations . Each element in an array is accessed using an index , which starts from 0 and goes up to arraySize - 1 . The array name acts as the base address for the array. Arrays are also known as subscripted variables in programming. Java arrays are of  two main types : जावा में, ऐरे (Array) एक ही प्रकार के डेटा एलेमेंट्स का समूह होता है जिसे कंप्यूटर मेमोरी में लगातार (contiguous) बाइट्स पर स्टोर किया जाता है। प्रत्येक एलिमेंट को इंडेक्स के माध्यम से एक्सेस किया जाता है जो 0 से arraySize - 1 तक होता है। ऐरे का नाम ही उसका बेस एड्रेस होता है। इन्हें सबस्क्रिप्टेड वेरिएबल्स भी कहा जाता है। जावा ऐरे के दो मुख्य प्रकार होते हैं: 🔸 a) One-Dimensional Array (एकविमीय ऐरे – 1D) A 1D array stores elements in a single linear list format. It uses one subscript ( [] ) , hence the name 1D array. All elements are of the same type and stored in consecutive memory locations. 1D ऐरे का उपयोग डेटा...