Upcoming SlideShare
×

# OOP in C#

3,378 views

Published on

Event #3 for DevMix Team

Published in: Education, Technology, Travel
1 Comment
3 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No

Are you sure you want to  Yes  No
Views
Total views
3,378
On SlideShare
0
From Embeds
0
Number of Embeds
57
Actions
Shares
0
199
1
Likes
3
Embeds 0
No embeds

No notes for slide

### OOP in C#

1. 1. Maha EL-basuony<br />OOP<br />
2. 2. Agenda<br />
3. 3. Array<br />a data structure that contains several variables of the same type. <br />One Dimensional Array<br />Type [ ] Array_Name = new int [arraySize]; <br />Examples<br />int[] myIntArray = {5, 9, 10, 2, 99}; <br />int[] myIntArray = new int[5]; <br />int[] myIntArray = new int[5] {5, 9, 10, 2, 99}; <br />
4. 4.
5. 5. Multidimensional Arrays <br /> -A two - dimensional array such as this is declared as follows: <br /> < baseType > [ , ] < name > <br />Examples<br />double[ , ] hillHeight = new double[3,4]; <br />int[ , ] hillHeight = {{1, 2, 3, 4}, {2, 3, 4, 5}, {3, 4, 5, 6}}; <br />
6. 6.
7. 7. Arrays of Arrays<br />int[][] MyArray; <br />MyArray = {{1, 2, 3}, {1}, {1, 2}}; <br />int[][] MyArray = {new int[] {1, 2, 3}, new int[] {1}, new int[]{1,2}}; <br />MyArray = new int[2][];<br />MyArray[0] = new int[3];<br />MyArray[1] = new int[4]; <br />MyArray= new int[3][] {new int[] {1, 2, 3}, new int[] {1},new int[] {1, 2}}; <br />
8. 8.
9. 9. String Manipulation<br />
10. 10. String Builder<br />
11. 11. Array List<br />
12. 12. Queue<br />
13. 13.
14. 14. Functions<br />static Void < functionName > ( )<br />{<br /> ... <br />} <br />static < returnType > < functionName > ( ) <br />{<br /> ...<br /> return < returnValue > <br />} <br />
15. 15.
16. 16.
17. 17.
18. 18. Value Parameters<br />
19. 19. Reference Parameters<br />
20. 20. Out Parameters<br />
21. 21. Main Function <br />static void Main( )<br />static void Main(string[] args)<br />static int Main()<br />static StringMain(string[] args)<br />
22. 22.
23. 23.
24. 24. Struct Function <br />
25. 25. Overloading Functions <br /> create multiple functions with the same name, but each <br />working with different parameter types<br />
26. 26. Generic<br />
27. 27. Delegates <br />A delegate is a type that enables<br /> you to store references to functions.<br />
28. 28.
29. 29. try . . . catch . . . finally <br />try <br /> { <br /> //the code that might has exception <br /> } <br /> catch <br /> { <br /> //exception handling block <br /> }<br /> finally<br /> {<br /> //this block is executed either there <br /> is exceptions or not<br /> } <br />
30. 30.
31. 31. Classes & Objects<br />
32. 32. Constructors <br />
33. 33. This<br />
34. 34. Access Modifier<br />-Public Members are accessible from any code.<br />-Private Members are accessible only from code that is part of the class (the default if no keyword is used). <br />-Protected Members are accessible only from code that is part of either the class or a derived class.<br />-Internal Members are accessible only from code within the project (assembly) where they are defined. <br />-Protected Internal These are only accessible from code - derived classes within the project (more accurately, the assembly).<br />
35. 35. Class Definition<br />
36. 36.
37. 37.
38. 38.
39. 39. Encapsulation<br />
40. 40.
41. 41. Inheritance<br />is -a<br />
42. 42. has -a<br />
43. 43. tire is a car<br />car has a tire<br />has -a<br />
44. 44.
45. 45.
46. 46. Interface<br />-like a class, but has no implementation.<br />-Can be Internal or Public<br />
47. 47.
48. 48.
49. 49.
50. 50. Polymorphism<br />
51. 51. Future Sessions<br />
52. 52. Q & A<br />Thanks<br />