idcsLogo
idcsLogo2
idcsLogo2
  • Home
  • E-Learning
    • Visual Studio C#
    • C# Dasar
    • Windows Form C#
    • Golang
    • SQL Server
  • Tips and Trick
    • Console
    • Windows Form
  • Submit Artikel
  • Laporkan Masalah

Property dan Method Array C#

Home » Property dan Method Array C#
  • Daftar Materi

    • Apakah itu C# ?
    • Mengenal .Net Framework
    • IDE pada C#
    • Variable pada C#
    • Membuat Program C#
    • Text C#
    • Var C#
    • Konstanta pada C#.
    • Operator Aritmatika C#
    • Asignment Operator C#
  • –

    • IF dan Else pada C#
    • Switch dan Case pada C#
    • Perulangan While pada C#
    • Perulangan For pada C#
    • Perulangan Do While C#
    • Switch dan Case pada C#
    • Operator Logika C#
  • –

    • Mengenal Method C#
    • Parameter Method C#
    • Named Arguments C#
    • Optional Argument C#
    • Method Overloading C#
    • Rekursif ( Recursion )C#
  • –

    • Class dan Object C#
    • Value dan Reference Type C#
    • Encapsulation C#
    • Constructor dan Destructor C#
    • Properti Class C#
    • Class dan Static Member C#
    • Keyword This C#
    • Keyword Readonly C#
    • Indexer C#
    • Operator Overloading C#
  • –

    • Mengenal Array C#
    • Perulangan Array C#
    • Array Multidimensi C#
    • Jagged Array C#
    • Property dan Method Array C#
    • String Object C#
  • –

    • Inheritance C#
    • Keyword Protected C#
    • polymorphism C#
    • Abstract Class C#
    • Nested Class C#
    • Interface C#
    • Namespace C#
  • –

    • Method dan Class C#
    • Generic Constraints C#
    • System Collection C#
    • BitArray C#
    • List C#
    • Stack C#
    • Queue C#
    • Dictionary C#
    • HashSet C#
  • –

    • Struct C#
    • Enumerasi C#
    • Exceptions Handling C#
    • System.IO namespace C#
  • Property Array dan Method C# |IDCSharp
    Property Array dan Method C# |IDCSharp

    Class Array merupakan Class dasar untuk semua Array pada bahasa pemrograman C#. Tersedia berbagai macam properti dan method dalam menggunakan array.

    Class Array pada bahasa pemrograman C# di definisikan dalam system namespace.

    Contoh:

    misal kita ingin menghitung jumlah, ada berapa elemen pada suatu array, maka kita cukup menggunaka syntax Length, dan apabila ingin mengetahui dimensi pada suatu array maka cukup menggunakan Rank.

    Berikut adalah daftar Properti pada Class Array

    NoPropertiDeskripsi
    1IsFixedSizeGets a value indicating whether the Array has a fixed size.
    2IsReadOnlyGets a value indicating whether the Array is read-only.
    3LengthGets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.
    4LongLengthGets a 64-bit integer that represents the total number of elements in all the dimensions of the Array.
    5RankGets the rank (number of dimensions) of the Array.

    Berikut adalah contoh implementasi properti array lenght dan Rank

    Array Length juga sangat berguna apa bila kita ingin menggunakan perulangan atau looping saat memanggil array :

    Method Array C#

    Selain properti Array pada bahasa pemrograman C# juga mempunyai method yang sangat berguna, saat kita menggunakan Array.

    Berikut adalah beberapa method dalam Array C#.

    No.Methods Description
    1ClearSets a range of elements in the Array to zero, to false, or to null, depending on the element type.
    2Copy(Array, Array, Int32)Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 32-bit integer.
    3CopyTo(Array, Int32)Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. The index is specified as a 32-bit integer.
    4GetLengthGets a 32-bit integer that represents the number of elements in the specified dimension of the Array.
    5GetLongLengthGets a 64-bit integer that represents the number of elements in the specified dimension of the Array.
    6GetLowerBoundGets the lower bound of the specified dimension in the Array.
    7GetTypeGets the Type of the current instance. (Inherited from Object.)
    8GetUpperBoundGets the upper bound of the specified dimension in the Array.
    9GetValue(Int32)Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer.
    10IndexOf(Array, Object)Searches for the specified object and returns the index of the first occurrence within the entire one-dimensional Array.
    11Reverse(Array)Reverses the sequence of the elements in the entire one-dimensional Array.
    12SetValue(Object, Int32)Sets a value to the element at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer.
    13Sort(Array)Sorts the elements in an entire one-dimensional Array using the IComparable implementation of each element of the Array.
    14ToStringkReturns a string that represents the current object. (Inherited from Object.)
    Angga Adji Surya
    28
    C#, E-Learning
    Prev PostJagged Array Bahasa Pemrograman C# | IDCSharpJagged Array Bahasa Pemrograman C#Mar 05, 2019
    Next PostStruct pada Bahasa pemrograman C#, Apakah itu?Mar 09, 2019Struct pada Bahasa pemrograman C# | IDCSharp idcsharp.com
    idcsLogo
    IDCSharp menyediakan materi - materi bahasa pemrograman komputer dan informasi seputar dunia IT untuk kamu. Mari kita belajar membuat aplikasi bersama
    • Implementasi Media Video dan Audio pada HTML5 Part 2
    • Memahami 3 Jenis Api Model pada HTML5
    • Memahami 3 Api Model pada HTML5 Part 2
    • Memahami 3 Api Model pada HTML5 Part 3
    • Memahami 3 Api Model pada HTML5 Part 4
    • Home
    • E-Learning
      • Visual Studio C#
      • C# Dasar
      • Windows Form C#
      • Golang
      • SQL Server
    • Tips and Trick
      • Console
      • Windows Form
    • Submit Artikel
    • Laporkan Masalah
    Copyright © 2021 IDCSharp. All Rights Reserved