Multidimensional ArraysOne dimensional array Multidimensional arrays... Attributes provide a powerful method of associating metadata, or declarative information, with code assemblies, ty
Trang 6Multidimensional Arrays
One dimensional array Multidimensional arrays
Trang 7Multidimensional Arrays
Row 0 some value [0,0] some value [0,1] some value[0,2]
Row 1 some value [1,0] some value [1,1] some value [1,2]
Row 2 some value [2,0] some value [2,1] some value [2,2]
Row 3 some value [3,0] some value [3,1] some value [3,2]
Trang 9Multidimensional arrays exercise
Trang 11Jagged arrays
Trang 16Var vs dynamics
Var
Need to be initialized at declaration
Errors are caught at compile time
Intellisense is not available
Not type safe
Can be passed as a parameter.
Trang 20Preprocessor directives
The preprocessor directives give instructions to the compiler to preprocess some information before actual compilation starts.
Trang 25Assemblies
Assemblies are the building blocks of NET Framework applications An assembly is a collection of types
and resources that are built to work together and form a logical unit of functionality
Trang 28Major Minor Build Revision
1.0.4.3
Trang 31Attributes provide a powerful method of associating metadata, or declarative information, with code (assemblies, types, methods, properties etc).After an attribute is associated with a program entity, the attribute can be queried at run time by using a technique called reflection
Trang 35Serialization and Deserialization
XML (Extensible Markup Language)
Defines a set of rules for encoding documents in a format that is both human-readable and machine-readable
Serialization and Deserialization
Serialization is the process of converting an object into a stream of bytes in order to store the object or transmit it to memory, a database, or a file Its main purpose is to save the state of an object in order to be able to recreate it when needed Deserialization is the reverse of this process.
Trang 38Assignment No.20: (Say hi in 7 different languages)
• Create a list of threads
• Create a class called Hi contains 7 or so different SayHi methods in different languages
• Each SayHi method has a name and a count to display how many times
Trang 42Ref return and ref local
Passing by value (using a copy) Passing by reference (using the variable itself)
Trang 44IEnumerable and IEnumerator
• IEnumerable is an interface that defines one method GetEnumerator which returns an IEnumerator interface, which allows readonly access to a collection
• IEnumerable is some type (List or array) that you can loop through
• IEnumerable is read-only
• If you just need only to read, sort or filter your collection, IEnumerable is what you need
Trang 47DLL files
A DLL (Dynamic Link Library) is a library that contains code and data that can be used by more than one program at the same time
Trang 51Assignment No.23: (Multidimensional Arrays Assignment)
Trang 52Assignment No.24: (Enhancement of Jagged Multidimensional Array)
• Create jagged array of multidimensional arrays
• Allow it to accept different types and sizes
• Fill it with data and display it.