Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
- CLR
- CTS
-MSIL
- Interoperability
- Assemblies
- Visual Studio 2015 Environment
- Console based and Graphical
applications
- Use of namespaces
Namespace vs Assemblies
- namespace is a collection
assembly is compilation (.exe or .dll)
- namespace -source modularity
assembly- deployment modularity
- namespace-one or more assemblies
assemblies - one or more namespaces
- namespace e.g - System
assembly e.g. mscorlib.dll
-command that performs any action
-rules for format and construction (syntax)
- what they actually do (semantics)
-identify different elements in the program
like namespaces, classes, methods, variables
- Rules : (i) only alphabets, digits and _
(ii) must start with alphabet or _
(iii) Case sensitive
-Name a variable
-Naming conventions :
->dont start with _ as it limits interoperability
-> dont create variables that just differ by case
-> Start with lowercase
-> For multiword follow camelCase
-> Dont use Hungarian notations
Primitive Types
Unassigned local variables
-- Definite assignment rule
advantages: -more readable and less error prone
-Result of numeric expressions
- Infinity and NaN
- An example Operators code
-named sequence of statements
-method has name which is to indicate the purpose
Method declaration
returnType methodname (parameterList seperated by comma)
using expression bodied methods
-for simple methods -its a short cut
- use => operator
calling methods
-result=methodname(argumentList)
Applying scope
period of existence
local (method)
global(class)
Method overloading
same name but different parameters
number of parameters or type of parameters
no return type overloading
Optional parameters - required when there is no overloading support
Decision statements
bool
Equality operators == and !=
Relational operatos <, >, <=, >=
Conditional logical operators: &&, ||
Blocks - group of statement
Third type of scoping - block scope
switch rules:
- use switch only on int, char or string
- case labels must be constant expressions
- case labels must be unique
- mutiple case for single statement(s) possible
- beware of fall throughs
Precedence
-new feature of C#6.0
Coping with errors