C# AND SCALA CODING BASICS: FOR ABSOLUTE BEGINNERS by SEL TAM

C# AND SCALA CODING BASICS: FOR ABSOLUTE BEGINNERS by SEL TAM

Author:SEL, TAM [SEL, TAM]
Language: eng
Format: epub, azw3, mobi
Published: 2021-07-22T16:00:00+00:00


int [] arr = new int [5]{ 10, 20, 30, 40, 50 };

We can omit - the size of array.

int [] arr = new int []{ 10, 20, 30, 40, 50 };

We can omit - the new operator also.

int [] arr = { 10, 20, 30, 40, 50 };

Let's look at an array example where we declare and initialise the array at the same time.

using System;

public class ArrayExample

{

public static void Main( string [] args)

{

int [] arr = { 10, 20, 30, 40, 50 };//Declaration and Initialization of array

//traversing array

for ( int i = 0; i < arr.Length; i++)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.