This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList arlist1 = new ArrayList() | |
{ | |
100, 200, 600 | |
}; | |
ArrayList arlist2 = new ArrayList() | |
{ | |
300, 400, 500 | |
}; | |
arlist1.InsertRange(2, arlist2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList arList = new ArrayList() | |
{ | |
1, | |
null, | |
"Bill", | |
300, | |
" ", | |
4.5f, | |
300, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList arList = new ArrayList() | |
{ | |
1, | |
"Bill", | |
300, | |
4.5f, | |
300 | |
}; | |
Console.WriteLine(arList.Contains(300)); // true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList arlist = new ArrayList() | |
{ | |
1, | |
"Bill", | |
300, | |
4.5f | |
}; | |
arlist.Insert(5, "Sisth Item"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
static void MySalary(int friendsSalary) | |
{ | |
friendsSalary += 200; | |
Console.WriteLine("My Salary "+ friendsSalary); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Student{ | |
public string StudentName { get; set; } | |
public string Course { get; set; } | |
} | |
public class Program | |
{ | |
public static void UpdateCourse(Student std2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
static void ModifyingString(string name) | |
{ | |
name = "Jonathan"; | |
Console.WriteLine("After Modifying inside ModifyingString method "+name); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
// adding elements using add() method | |
var Idnumbers = new List<int>(); | |
Idnumbers.Add(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
IList<int> intList1 = new List<int>(); | |
intList1.Add(10); | |
intList1.Add(20); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
List<int> intList = new List<int>() { 10, 20, 30, 40, 50 }; | |
Console.WriteLine("Method 1"); | |
//foreach with arrow function |