100% found this document useful (1 vote)
3K views216 pages

Sudharkar Sharma (C#.net Notes) PDF

Uploaded by

anil kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
3K views216 pages

Sudharkar Sharma (C#.net Notes) PDF

Uploaded by

anil kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 216
C#.Net By Mr. SUDHARKAR SHARMA Naresh | Technologies SRI RAGHAVENDRA XEROX | Software Languages Material Available | Beside Bangalore Ayyangar Bakery, Opp. C DAC, Ameerpet, Hyderabad. Cell: 9951596199 ve NET oO: Managed code is tndepemdenk dom os Componus+ x: Lamquage = VB.NET , cae, Oat THe *& CLS & CLA TIT Compiler - Tut im time Classes» : NET 1S @ framework , collection of several clascer | Framework fs noting but @ class - SNET iS framuvert {s Siw frameworte inte duace'd yy Wiceosoft to develap vaxios types oh applicatiens. a Te Lowprises ofp fpllowing couponents. NB Cre cat Tsenipt Common Vanquage specification j ASP NET ; Web Sexvices windows | amd web forms form s 3 i ADO.NET > Dato anc XML \ Bore class libveve-y Common language Runtime. +. -NET Framework comes wits tuo lamquages like VR WET , | Ch TROP Teh a Suppart por Sevexot tigrd parhy lamquages likey ports python. CoBol. pascal ete . 2. lonquager oxe required te bwld opplicarions SNET frame -work support mutriple lanquages “Se thot # it cam clevelop omy type oh application Fe, “Scfembipre , wisn ats qonuxal puxpese eke. s- "NET gramenorl prowides a commen lamquage speuifi- ~ cation (crs) for all ‘larrguages se thot applicattens axe lamquage — twiexprebaole » Le, apphicakion developed in one language “com we deployed mM camotbér lamquage 4.-NET frameoork -pravides a cle» engine apr “NET applicationg , The ee oqein com- which a runtime =prise sh sevecol carmponents -\ike das fodder 2) (tede manage 3) Pebug mm am ages a) Seoarty mamaqer Thread “Support “Mamagen “ExcepHon Momager Tyre checker Com Man thle Gorkage. collector Tt compile 8- The TIT Gmpilee CTuit im time) (s Yesponeible per pramdasing ivctetrnidiate language code inte the nahive cade ob os CLR “Execution model One cu cm __ Unmmamaged o— compen Compiler compiler comps} ex. l \ U mamaged Assembly Assembly — Assembly wade Ti wode TL Code Xl code a Sexi cer [peng Stee “the managed ede is plotferm independent and 5 need fo be comescd Mtoe the native wde of 5 O 6.The -NET framework exposes 4 different types Cc of Case 2 a) windows --forins ‘“clascer c CTs develop weh windows -apelicatten) Co gy Ase NET -closses S (Te clevelop v¥eh web appicattens) zs ©) AdO.NET amd wm Classe: . Te momipwase the data access ca) Base ous Wbroxy oO Cope ceeunity, amd tyvomsachen management’) , feaswuu eh . NET C | cot Bree fur cionality oud at the box. F 2. Easy ev elope + sh opplicattems a. Rapid applications clevelepmen+ C por) 4 Must! lonquote Suppert -clevelop amy type of a pplicaon OO S+ MUAT devvee support co 6 Nowert Dit Hel - Dynamic lime Nbrarcy c MulKPpl< appli cotton | fe Sheng assembly © 7 OOPS support : oO POPs + Proaus oviemted programming system 5% Pascal, c € — copot Cc OBPS ~ Chie bare Tava: 5 V8 Sexph, VB Oops + Objecr oriented qeage ~ CH Tave , eT c g- leosedy ‘coupled amd Extenglole (oops) q- Seeuity Cooded Whatever You write you cam ‘protect st do not override it to. Strong XML Support - ne. Audomah'c rounony mamagement 12. COM amd COM+ Compactsbility Lovmmon object model TWird party conmponent ® wher is pit Hell 2 The applicosions thot are we installed im machine. axe oO Supported with om assembly ile that have the exicheton Th ory new version of application is installed on the vsame machine then ie over weer them existing DLL overide file, O = Hence ovdy the latest veuton cam run after rachine This fc Mhyred te as DLL Hel. How Dir He Selwed Mm -NET + ANET “(wtinduced a Strong assembly -thak maintanamct, muddiple veutons fer Del files. Hence, ditjexent versions & Same applicatims can rum om a machine “TW ts also known oF wide by wde execution S Micwosopt xeleates “NET voit 2 mafor Componem*s» They axe ~ framenooric ¢ 4 2 CLR O 3. Development toot ° Gemexation elk version “Released dake Development tool ©) oo 4-0 go02 -02-13 Visual Studio. NET ° ted a4 003 -04-24 Vs NET 200% ; ° 2-0 2.0 goo8 - -0F 200r 2 3.0 2-0 goog - "W-06 Mico sey blend _ cao 2-0 octal 4 Vs.mET “2008 - ae 4 goto - Ou- 12 20\0 us 4 aor 8-15 2012 2 467 4 2o1a— 10-1 2018 Qed 4 aelh = 64 -0F 2013 . io 0 md poxty 1 Telexik Deverpress oe - Window Presentation foundation Fem some multimedia. for development - Te added into Foundation WEF ~ Windows communication - Mandatory Knowledge for developer Nothing bur making applvcatfon available Yor even device a0000 Bx. Provide amy where sexvice, ok “The .NET ravnesork Stace & + Mode Ut “yak bosed bet bum sme Async - model 7 Poxal el Vouk pou 40 : LEN. evan C . ae Emig Fravnework, Wweel [wee] sel [ena sral 88 wis ae ne Aspe nek Apo-nes| forms [a = [Ave — ‘, frameserk 2.0" ** framework — class worry | [Gemmen Tenguage swntine] | AL version of 2008 fs called a000¢ oo mmpttiventon Bnvivonm ert The NET framewort the yextion 2005 (5 a multiver - ie allnws you to develop O ~Himing emvivrement 1.0, S appl’ casion whidh are Compatable with ‘olden vextong O & Ling isa Rupe Quoy Apprach Pp PePS, har wmolntase Lhuncions. directly Undextonclable +e hax Rlware ie, fart, deaweack - Lode s4f. ic wo} posible, Seaicity problem. exotion wey positbte, Dynawe mumony Ailecasien WOBRS: Tihexttama wet sugpoded , Paramte polymenspliew ip a ek eee She, Commer aurea aT» Higery + 1D Fireroop lang. war dimovered im i96o's .Tohaw oly | 3 Kaisa Nugaarel (¢muledion . Systens) 2) Gemulasion Gyro Means working mere thom ove Protutgen OoOo00u0 3) 5 Super Compuroe axe mMly pruemt+ ih India. “Eva! is the loser one. Sc. Support Simulation Systums. »} 4) Givanda ey te the fivstoor bared Lamg, code Rursabilidy achived 10 5) “Da say's, Neo coneepr 94 Code Stpecation -j.e, MYC (model View Cowmolien) indrdeuced “moll rae - s £) Java uving mvc beg . Net used mvc Frown os Asp wet Myo D Wau +alle hos beth code Reurabi lity amd code FepexodTon comp ) BEML, B war machine depemdemt ie, they axenet portable 4) C was Portable & Was ininduced to write Keener C core) ab Unix 4%) Ledex on ctt +aket place of cy dhe Visual ett ‘Came ite exidamee Oo We late, Java makes OOPS more Popular C 12.200, Cte was inteduced by wicroropt C 13. CH jwore sharper than crt » Th music (ar) Tybol was ~ uted means Chould be pronucnce at high pvheh WHE Ve Codready regittexed symbol ef music, te wriowbp weqittered with a new Symbol ( Fount) ts. Doh & Cita+ ane lomg - arith the help ef elit “He dexived + LS Cc 16. CH TS am Tso YESMA S¥umdards a7. Stee Standax cisadion = Tso — Tysernradiona Srindards -orgawwations TEE: Asia fellows Hos Hamdard - 7 GAM 2 US follows Hys - Standards ANSE GeMA: Euxogidn Compustr Mowfacentt Artoctedon a0 ¢ Ler AL Mobiles hos ta jollow Gin Syma GStamdax ds ( msrerels) S — — we CH (eraxp) 4. POPS - Direchy twtecack with haxdware « ferkemance, will be 22 OBPS - Very kort im comping “Ta not empler: 5.008 ~ Draw bade entro\ied by functonc: of Coss wh nok Support Sepaxaivon imporiamt “for development Dynainic aliocadvon axe vers memory Te will wot ‘suppork DMA Tk wilt vet Support -seaueity No ‘code level Secunity » 2." Evexy Aasng will be Controlled by olej echt Phey commot be exten -ded or vnodiffed . Tk will net support inbeuttamce. polymer ply = sv %- Te has Searnity , code sepexation « fveything. ‘s cutemize AA tad time development applicatrons DAT Vou complex \9g0- John oly, Kristian Nygomal . - Sivmladion System SIMULA €F Cops - 1q60 ~Code reusability lato - Trygve de Seperation - MVC mode “view comrades Namquage - smal svole Lato - Cad ee cet ogee Tadeo BcPL - Machine dependent (ago - Tava 2000 C4F — Micrasebt -d0ps lonqua cH -- Tso EcHA Proqeammung Syston ¢ - The veal time applications ey the foblowing prop programming Sysier axe developed by uring amy one 4. POPS - Paocwss oviented Programming systern ae es OBPS ~ Objed based programming systen . 3. OOPS ~ Objec ‘oriented. pops - In Pops the main tak fs divided inte several Subtest - Evou subraie fs demoted ar a fumciom - These functions axe always pwttqraded with main task © Advornsages 4. Thay com, divecty 2. They one light weighs doesn’t required more memory , jrkoad with hardware Drawbacks 1. lacks “Secuucity 2. will Wek Support dynamic memory glecatton 2. Pouvet have extensibility and reused ity Ex. ¢, paseo > coBoL 2. OBES Tn oBts evoy intteack “1s conreiied by wating object They “doen't suppork -Exteneiility amd ebjectt “Came “be customised + OR AdNonrtaget 5 ‘Supports rea tet by ligne weighe Reduce overhead % Raolving of oops Languages: . sr i - Ve The "45" cops SIMULA SH iutreduced by Tehn ony oly Kaistam Nygourd th easy 1760's 5 OOO02 CUNY pode reali lity B- 1410 - Tryqve ~ Code Seperation amd fyemulated it with the Jamg + “'Smail tale A- OPS Pepulor with C++, Java, tat0, 1aa0 5S. Minosoht introduced i's 4 ivs+ Dops lam quage. C# CYhoxp) 200¢ . whith beengs 42 the darily ob COB Gt. But ues fea- -turts ob ctt > delphi 6. The werd Sharp is derived “fiom ca musical wmode node, which weané fo promous “the wode ‘ab Wgh pitch T+ Micussop+ Antonkton 16 “be Mmdicabe that Cae fs Were Fhaxper thon c++ g. CH fs am Iso and ECMA Sramdaxcl lonquaqe ECMA ~ Euxepiom Lomp wer manugacure assoviatten. # Types of “applicadions Developed uve CHE 4- Desktop applications 4) Congoie applicationg b) Windows forms applications S Lc amd optonally - Dotabaie] 2: Web Applications - [ew sve B asp. Wet] 3+ Distributtd applications “(cat Jug -b @ whe & ASP. net ] 4~ Mobile applications [est Jve @ mvc B Ajax ¥ fauery, word oe Assembly 3- Am assembly aepraents inera hota 2. Metadata is dato about data. ie, Tnfermation about . your applications . The information cam be vextions number copy right oO oc Memory hardware requirement » etc. 4. Assemblies “axe Claseigied into Hoo Major type- a) Public oF Ghared ass embly 7 v) Privaie assembly - O a> Public 4-The public assembly is global im accers- 2- Tt iS snared fo smu ple. applications 3-Te © ofem vebers as GAC- Global assembly cathe 4- NET introduc a. stron g assembty fro contains vyudatple Voatons of DLL ple S- Tr (s stower im access bur occupies les memory. 6. Whe location ely public assembly in computer i's " CaN usindows \ Assembly", 6) Private 4.Te (s local to the application ama rs available wy toe Specific applications. 2. TA IS forte fw acces but ocaupied MOTE Memory, NeTE: AML Ossumblies axe culture neck neutval . “They C adept “He culture, eh “machine » Ty the assembly is Cokie — speugic then if vs known as ‘Seatilit ‘Assembly R Name spaces - Tt is a Woection of vulosed Hype of classed amd Wb — nomerpace. The Applicosions axe buidt oy wing objects, ovytntt are cdexived prem daises and classe ane occer “SH ble fim namespace. 3 C Nomerpaces com be Wer dened oF predefined (implicit) 6 © The wrwmowy Available Nanupaces in Dot Nd are GA Follower Rowmespace —erceiprion Cf. Mystery Provides the base Claus Vibvoxy dev «Neb framensrk 2. SystorsColieations Provider classes that are required fer handing. @iettions like POHL Stack , Queue , ete ¥. System. Data Chaser thar cupports “data acer . 4. System Diagnaiics Classe: Prat are required fer precesting Applications AG Syston «TD Oasser that supports hamdting, fle 6. Sgt Text Classes har Supports hema ing vringa. 1 Geyser. Threading Classes vequived fer voultttorteall ting, “4 Gyre windows Windsws form Chantes 4. System web. UE Aspe weber Chane to. Syptore UENO Usted thar tpperk LENG opexations 8, Cystera. ML Crosses Hoax Fuppork XML Schemas , read Schema , vette. Shem BR namespace iw Cit com be ~tHpued rthered in Hote ways: Vs Using fully quabitied Name: Caster Diagnost cs. Proce. Ceudkcy , “4+ Taeporting mame space» EX Ung system Diagnos4 5 Pocus - Sor O3, » Misting Newnespace : Used -o ~tmove Ambagusty Ex, Wing sda Oy tom Diagnoeha Sd. Process Sraxte, + Conwle Applications axe used +o conhol service sy Os Wed COncrucr appiicatins jprtnne devices hich her less meine opt laf amd Wr doen't support mich qaphital interface 9 SHWOx? 17 Namespace pectaradion 2 4 Type Vecaxosivn ( Lass, Stud, Emum etc) , M Wembert. (propesies methods , event, ete) 5 a TAL Cat compiler to devebp CH Applications a ) Tastaut sWer pramerork ( your compador (Weualsrade aaigy 7 2) Ofem windows Search i t1 (Whdew Key +5) 9 Tyre © visual studio Tools” 5 \ Sed Visual studis Tools amd Double Gide and opem “Developer command prompt 4ev VS20I ° = S) Test the Compiler Ct\> Cse (Pretiel) [sou cam use fully quatiicd namespace, fo fb i hed mand octory FEE J mremion vamerpaces + Momace 16 The aeembety onbme Compiler “of + Net Technslogy ANdoPed by Visual studio 2 Rostyn Compiler is the latest Gopiler which modifier the App lcodtin, : Progra autoynad ica Uy sh ame modificoson is done Tn pucce code. % CHE -Conele Application = ‘ +The canvole Applications are used to Comhal Seevices ok oS and yo develape DpplicaHon iuierface of demces that doesnt feppert -ds memory and UE +The Convole Applications in Cat Comprises of, 3 main Components + 1) Nawnes pacer? Covdains +yper & they names paces 2) Tyre Declarations, Classes, SHUG, Mibex faces s emume & Aetegates a w c 3) Memberst Contteimts fields, wettoads spropechier , ents , opcodes ,Constrcturs amd destructors Be Crtating Cat code Application + ') Opem the editor “Nottpad” 2) Tyre the pellewing code + Wing Systems Vamespace Projects € Cats welcome £ Public cafe Void Moin (> £ Coniele. Wot teline ("Hello Word"); 3 Moin tmds 3a ders ends indexes @ % UY Nemeipace emds- %) Save the ge in your hard drive with extmpon (. 65) + & ESS Paodaam\ weleome.¢s 4 Open Visuol Suda Deweleper Command prumpt D6. Compile the pega Es\Prqpram % cee Weleome -cs + » C qemerates om Breutabre Fe) 4) Rum the proqeam m Ex eee C1\> Welcome -tye flamatation of the programs wyprom" vs the base womespace phar Supports the bosve puncions ob Ctr % *»> Gots welwome” Go the mudate thse ‘Namespace Prsject” sg a user detined narmespace emcapsw aber ~he ade ° Ly" Maint)” wethed is Gy -excky entry petit 44% Prem 6 amd every proqram can have uly erry pole _o oO 5) Evexy (Method must Tetum a value amid mam method 6 cam net rehwen (Mf VOM amd will “ot have a rtHHuny O types hemce it is decaced ‘as Void main" 6) Moin Method i's thah’c, which indicat: thot the memo allacated for main will vemain constant even When the muthod ends D +The Keyword Public indicates Hor main ie a acrevble fer amy location = 4) " WHKLVE OO" gs am oudpur fumdion in CHE eo All ane ner eyeadable +We Cam find the stuchure A program wilh the hetp of TiUDaAsm o* Creading a private assembly gov your Program Crue Fle) 7 erN> Gre -4: ibvary Program.cs c Prrqearn DU c &% How Com we view oth dit pple Stuche 7 aS 7 BY uring the UHIY “'TLDASM £2. esse Tidacm peqeam + DU c ee > fo & Dye oa oukpuke yruions im cat + Bawe Tupur ofp 4unuton s i © TTnpwr junctions + C4. Read() 1 Tr vtads the beycode ef the character “thok yr have enced EX Ae 6B Ley der “a ReadLine 0) + Te reads Yue tnpermodiow har you have emkxed ov cCommele Screen as Sheng © Bh peusote. WeteLne ( Coneste-Readbine (9 5 cr> ABE ofp 2 BABE 4 Quepak eeutions? 5 wer ty > Te verti Phe twpprmiadons on scree amd yokes the cursor walt in the same \imer C’ Ex Console write Cweluome")5 ~ ofp Wadwme— 2) WaiteLine O + Te prt the owtper in a ness ime be. cnuer wolkt xo the wextlinve. 2 Ex. Cganyvie WHIELINE (owawwen)s a P+ wel + wome oe Types of ips im console Applicahions * Se copplicadions the (npr com bee lowed tw two Alfipecent wor cy Commond Line Swept C 8 Teas sped * ) Command Vine JP 3 jp fs provided to am oppicabon am enry poruk {Man 03 2) beyore ok Stacks on fk commas y anor accep arguments - z ex. s Uenq Systems 5 ~ namespace frofeck ° : 9 class Commamdl mele : ; ‘ ; publ'c Static vord Moinea( string £3 ary) g ° Conrle wrk ine (“Helle | fox") arp [Ids : : 5 : 3 oO Points i The main method is accepting siring ype axqurments amd squaxe bra [J indicates move -tham ome swing » : 2) A the stings dre Stored iu the meferemen variaele “age” cmd oxe accesnble by index number arg [ol = String t a als] > Sting ? 9 3) The owtpae function “yorkLline O" is having the rbecemce 8 §0}" which Mmdiases the fiver value thal Comer hax acer ayes the nds ok “eres quotes ‘ €x. aegs [od . gum the proytar: Cie Command Line TP S fay Kumar ye > Mellel ay” heres Pasting axqumentt ito main metned is mandatory owy when Me program is wing xq nents » 5 yemate £0 fo} i Comtad neon opacaion + @ a Z Commrle. Wrieline (“Mette ("Fay To); “Fe will give We Same output Co *x (ew cabenadiny the Sing amd vaouable 2 exe there axe too methods for concasemadion \) Refexenen type 2) Loncademasim — operatorr “E43” ex: Wy Comrle Write Line C”eno’) "4 Ong Tol +" Yo CHES D Vving etree type © D Treracive inpur+ Cesnerte -WritLine (“Helo | £0} weltowe +o CH, Te Wel UM 2 ox Lol) Ther is provided oe the app cacion dusxing ne vente amd We is referred OH Twlecactve impur - We have 4+. use whe basic par fumcrions te ~tad cupur fren csurole Ex. uring. Syston 5 Mrammes pace Proyect Gass Tnicrackive xf t public state vord Main c £ ~ Commie + Witt (Enter your name"); a Corte Wrkline (“Hello Cope, Conpele, ReadLine(>); x Visual Studio, Developer Express, Teer — : www. drannel Tmsdn.coure Vi'suol Hncli® connected wets He. by the devetopext : we mgd COM & bel hele tow ower 5 cemsore . Readkey() 3» last shatumeuk in progam . Dy we write ib nen the ceuvete. window will wort brie wite bo pros omy key amd ouce User pres: amy key a ther the toute window ull be dored 20 Developing conve Opplicatvons wing wSual Studio. 4s) Microsebt ‘Mitoducs a devtepment tool with programs—> Vs 2013 - vs 2013 Crpe) : 2. Atle opening VS got die menu med project. 4. Specify the plowing ophions a Template 7 Vicwal CH alee pa Paoject 2 Console af plicarron framework + VS 2013 Wo Nome. + Cholder name) Solunion names Same at folder sin lecaron + Locol drive (v,£,-..9 4. TThe baie file Systm of every connle app licadvor comprises, of following elements. | Componemts | Description - _ nn J - ceuterns assemply ings - i cgiection aby \eren tay » evers4 lilroy camroms Sry prowdes cole ay awmeapmced . giebal opplicodion aovfrquratvom file, wlth tevie'ns St oh prpecter to wutrot the apek@tiin behaviour: Te is a defaubt progeams gile- k compile and tun coneole applicatton in VS a. Write o pegram in a file program. cs 2. Press cords ener “Ctrl Chife +B” ket, to build the solusiom (ie «exe fle is generated) 3 Press fs ts run the PRyam - pras Grit ee te Tum amd Paule the conele- Note | You com otic WE The dwencavern Coneele . Ready 6) fe evoy prgrare of last Stwement , which pausu the Commle until you Pres amy Key, Adding nes programs te project ve Right cick ow Prjeck name in solution ey plore pe Gote the option add wero item B Select “class” amd them wame it as “Welvome- C5.) Se Your Proytam Mh Stoxrup + 3. Righr chide on projec mame iv soluston ex plover amd sdleck propedk 2. Tn propentiea window ge +o oy plication tab s Gets the option stautup object amd sdecr your Uess 7 Mame we Tutbying the ude in deriqner 4. Seed AL = Chl tA 2- Block the code - Ger Crit FD- x Comment and Bee Uneamment a BloUE . 4. Celt FC ~ Comment a. Cel + B,D = Uncomment CSeect the lines) & Mamual Comments Wo Binge \me wenment- . Pf 5 AwHline Lawment Yi + XML Comment - queen umdertine 5 deleaxed lot not we Sting Ching + 4 dakohyoe Claas SC Naxiabla bk Dodahype alos Variable ore vimygly Storage locations ‘for data. You com place. dote wo them amd vetive their “Cowemts os a part of amy cat expression Co The tprttahin st de date tna vasiable is controlled thst euypes om wa Shon yy Ayped Namerage ious oot ane ~ owon-voriables axe commaited amd pertewned with annder. ~ ~abion of atheir datatype u The dosatypes iin cH axe clasctied ‘nto two moje typer dD) Bete Build iv types or implict yee 2‘ User defined type ov expliut type 4) Build th typo n The built im types axe swuplicitty defined by the Compiler Systema, They axe again clasvigied indo too types a) Volar type 8) Rafocumcr tyres a) Volue types: 4) The value type axe Stored tha memory ctack, which uses ae principle losb-in -qivsh-ouk (LaF) a) They have a fived wre 3) They ate now- nullable types aw The value type are again Clasted imo pollewing Ayre: C8) Borleam type © ay Taeqeo! tyre - 9) floating porwr amd dedmod type _ ©} Booleans’ type : Boolean typer axe declared Wp busing the eysord * pool” They umbaiv two valet: True on Fale - The defer boolean type will be Jabe- - The becleam venditims one sahtfied with the keywords o \ ~ | Fre or fae bud wot 9 or 4 Syntax for dedoxing © variable : a 9 dosabyee Varablename = Value 5 Ex. bool YouAve Major = “true; 9 * Vowoble naming Conventions ¢ 5 a. The Voxiable name com be marxinoum upto 256 Characters © 2-Th cammot stat with a number - O STE tom sted with an alphabet or Undexscove bs “Te com be alphanumeric withow any ama ome spaces. Except) Special characters 5 Voxtable imame must be unique csltrin scope, Oo 6. Vaxiable ames ane care Semtitive - Ex. valid Navnes ; | " ~ dajabare | Using System s Name 123 Mamespace. BooleariTy pes Fiver, Wome | ass Program Tuvotid names | £ | 123 Name static yerd Mow First Name } a boola = tue; - ‘ boolb = fae; * § price, | | Commie writeline ("TRS LO% Firsh name | wo $or ‘oscleam +ypa ” Progam $e | Hhot CHAS Strongly Typed, 005 Congoie -Writline (“Above Semtemee fs Mot (04" b)5 3 Nole + in wongele wrieline | here voile using | boolean dlatarype | 3 i “Ha is ner alowed tee ondy! a | \ ge Treepal typet = The integral, ype axe whele wwe ether, Fyned ov unt ~yred They Cam be Used +0 cowrel operations with vuminia values. CH Provides the Following value eypert ivbeqrad nypes |_ Tee [- ver tmeaa | sbyte — ——T wnunvalue 2 To Privt | byte g | wunimunm value ole | Short \e oO datatype short 16 1 Bt | c 64 | | ey i \e- } Ex iwt gales = 4000 5 ink Sales = -40003 I wot vabid . Siorpe J aond yom | % Wnt salu = ~ 40005 Pky te be chowe iw 16 Fok 37 | -\ A CH povided a Fymbel 2 fo wepraent the varw'able vate, os wal: . ime Le mu iwe 2 mull % eH) Hosking pont amd decimol type: The floating pormr amd dedimol typa ctpruent rtal num beu mothemascal and sdembfyc operation thes axe used ter CH provides the follewind Yooting poiwe typer g eo mene Pee? _ # vize (in brts) | preettion a) Hood oop 7 apes ——+ 9 double “ \s-te digits | dedvoak | 128 | 2g-24 decimat placer} © The dehemt tol wumbes iu CH axe demoted of deuble type i order te define dhe oot! we the sukbix #' and fmt fer dedmmal- EX Pook price = lasets double Sales = 5600-704 5 decimal saloxy= “C5007 77Ms ane 4 ma memony heap, + - ec athena type are Stored * _C ae . one fet, Hein Kzevater a) They do wot have amg fixed Wee F accordivig te Hae cownpuker Virtual woemory. Aney cam be A wee syper ore nullable ype pe 2 astigned wire ww . ) Cae provider the following. atyeme. Hype 4. Siriwg ar Object 4) Brg. A ging fs a sequence of feet characte) @ eme- Mou tom creat 0 String With a obtng literal ce losed im (' ) Viterat quoted » wer privdable fhe Te print the non 8 privdable choxadou, CH provider Several excape sequence Choxacterct- - Escape Stquenae nearing t - N | Sqge ace a - N \ C Apuble quote | S | a backslash { o | \o | — | fo Xe | belt \ c Ne \ Back space | < Me form feed yt teh onesies ticket) c a mua ne em ome page ] \e caxxiage.. ren =. C oa Horizented. Tab | | ~ Vedieal tab | “ grring mame = “Tohn™ » ° srivq path = “DI Mowe: WCEP. ay", Cc Shing meq 2 "NY Weleme VY AM OTH VE cae" 5 (Welton To cat) o Shing path 2 @“D:\ Movies WP avi"; & Verbitad chaxochtons car 4.0 jweduad the nao verbrtet chorack. "@" that cam mole the sting to print the iitexat 4exk tracy ad entexed. amd avoids the We of escape Sequene x" ging path = @ ” ps\ Movie Clip .avi"s 2) Object + System Object = Berived Prem (objeds fear Is derived from Sytem - Single ~ Bouble tyro Bocble inna a Typttin . Deeimad ae Be iwRVidtty typed nox abil e+ 1) Must be iwihaberd. 9 Conmot assigned te be wall 3 We om ately omy hype oly vole Qreapt mull H Obseck Th supports all clos set im NET dou Wenacdyy “Th is the ubkimott base chats for al chases fm NET framecork. It is the vet Hype ywot type for all datatyres Ty you are not Bue about Hoe incoming value then. you Com Use am obj ~ tc type to Store the vole Ex. Qpject solaxy = 6000-644 5 objec name = “John's objec Age = HUs « Twepiictty typed variables c 3) CAE Supports implicitly typed local varialeles whese dakehype will be deexmmined by the Cornpiler actwrding + the value ¢ assiqned “They comnet be nutrable ond Aney mut be Wit: alized with ‘a value- Ex var galaxys 4000-603 Vox name = “Tohn"; x vox Age vues If twrobid - Vax. Debs" X a ull repcence Character ” The vodue Ayper axe mnon- wul- O F ° _able f}ypes bub you ar Aeiqnote them ot natialle ache Layee by sing the Mut wegen ce IANO, Gop Bee ae Ages nut 4 | tnvolid © > Wer L Ages nul $ Tf vabid— &k Dee typa im ¢ Date amd Lime you town dtiign atten dota amd Mme vawe iv ce by vatng the grated datetime Te provides Shek propecsres amd methedt to mamipwloke amd print dosers Exe poseTime “dase OF Birtes Ex. Console -Webebin e ( DakeTim e-news DadeTime - New + Teth ort DottShi n 7.095 DaktTime -Now + Te Long Date Srengos DueTime .Now: Te Hhovt Time Steng eo Joretime Now TelongTime Shing Cy; Type casting » Conveting one vouable avamotner datatyre- # User dekined datatypes Cit allows fo create O mW tyre exphdtty sethat we cam create wpe ok Ghat Speaitic type to Store Hrengiy Aryped Vosetes , ey ane agein dosebied ints two Hye a) volut type Ex. Suck, emu vy) Referer types Ex. Class a Tyee catting, © Type couting. (5 a paocus of @nvading ene dadatype classified inte hao pe omtthee type: TE iS moi why 4) Topliit sype canting D Explicit yr costing a) Teplice tyre cosking + © The prouss of vonvesting a “\awer “hype” vole inte myaphen Hype" i known ot imaplicdt type coming. Tr is Under the Contr) ok Cie : Ex. bye belo; — lower (byie) TW C= bs = Wghen cit) D Explidt type Coating : The Compile Mptom Camnet conver omy Wiqher type value into lower type impliiHy sHence an ek plicit Convervion is requirtds voluich 16 wmder the Lonbol of develope, Ce Supports feue different types of explicit hype casting Wetho di they are 4) Cth bype + TR is adopted from the Tanquaqe t+ amd i Cam be Used avy to convert amy volue type tube ameter volute type. @ ° ae tos WY Wither pe > byte be (byte) C5 yy jower type } Ex. String Se" Prachi” 2 : a twas 5) iwh fs limes 4 “Thus we Comnot convert mq o omy She 1g. tov ctype 2 Paxsing Every valae type im Cit is provided with blewsing methods amd propextien 3) Equa; ~ B Dedumine whether the specified objec is equal to die ‘ue ~ “emt object , 2 foxte. Tt converts the Siving wepruentadin into Fhe specie datatype Cvolue types) 5) Max vole: Rekaxns the maximurn volue of speupied type. 4) Minvolue 2 Retwems the minimum votue of specified type. Notes Paxsing cam be wed only to Uonvent a shing wepraen + asim amd camnos be wed fr amy value type. 5 EX. tnd Age; ‘ Congole .ovite ( Eyer Rae ds Age Vn - Parse ( Conrle Peadlinecy) y Commie. WektLine (° Aqes “+ Aged: 3. Converting + : The conver cast tm CH prowdes oo ser of tee du that cam Convert amy bare type (wee another beer base ype ex. - iw Ages i Congole write (“Enter Age"); pe Age = Covvert Totur 32 ( Longle -Readlinets}5 c ; Lengle -Wrieline ("Age = + Aged ® Boring ond Unboying: a The procs ob Wnverting 0 value type tuto weherena tyre ie know “=W ad boxing. 2 Converting o ~ehexence type cuts value Hype fF cabled Unboxing. Ex. ¢ ‘Wb sates C Congele write (“enter Satei); ¢ a Unboxing © Saltb= Lompote tater Convert.Toink32 ( Console, Readline O95 Tbexing Comtoler yer . 7 > currency hype . Mga eaters Ages" 4 Sates 7 Tasting Cmeny, ah Exarnpie ¢ Uting Sytem; ¢ = Namespace Type Costing ess program stone void maint Live proaucetys srring Navyne ; Syloak prices DateTime wameds Congte. vote (" Evter PodudiD')s Product ED = tk. Paxte ( Console. ReadLinerrs; Conmle, worite ("Enter Nowe"); Name = tongle. Readtinetss Concale. Wik ("Enter price Ss Price p Head pases parse ( Comme. Read emery; a Congole. lott (Veter “ maomupactioutch dake 9y Médz DateTime Pacse (Conwole Readtine (15, 5 Coumle Wetelne (" Prduch dedalls = Conmlerwrteline C"Tpe".+ PreduGtD + any» amel ey Name +" \W" 4" Prices” 4 petce Tasting ('c!) b\w he " manufecturing dait= "+ MEd. TeString ("D")); t 7 a a H Operas th Ge -.9 The runs are computed im a peyarmrng language by bui~ ° ~Idonq exprtawans , amd the expreitions oxe bust by commie inivn > voriables amd opexators together iwto Maememtt. The cH opaa- ctors axe clasethed (who thete mojer categeies > | 1) Unory operators 2) Binoy opercuhors 3) Tene opercctor AN opexators acenrding to their praidemcr axe Yow) | boeboup—— — c { T careqoy, (ey precedence [ operators s | a Unay yee ee : a. Mud plicadt v & ef ate : A shad ve . a Wit "fA 5 Ratodtonos ‘sas = oe Cquel ea ~ a. logical AND td a g. “Legrcot Kot tT Lloqicad oF \ 2. Condom at ANP Be wu. Condikenak of u fa NH Coalescing ee V1 Teoemony Aseiqnment Note: AM operators iv tee Cam evertoad except the bellooing ~ 4 Dek GD 2. & 2s 3-1 (me Mhedtamee spexodor) Ex 1 Unaoey : We (E05 44s comple writting ( oe 2-Binany twe fier Jao; fonwle .Writline (Co bddisene”, BC 64j905 Op = Addit = 30 3, Taemory « ine pi C Consrie Werke (“Ext yar Pin™D5 tne parse ( Cminte. Readtivel 5 149R Y "Success S pin = ee © Connie writline Cpr MY pawadil PIN” YS ° % CH sosements: ~ Stakcments axe proytam nstruchows execed S geden fo ConrD the pregtare foo omd te pex\prme Varun - YP ob operadvome “The Apleving qe various categories 95 grostamemts along. with thei eeqooy ds - ww a sequentral Careqony Ca lwporrda \) Sleeh’on statements i} else cute core aTkxabon stutument | clo, gor 5 fortach, et in whtle - 3. Jump statements break, eMHuue, debauth gate, retin wo Cxegrion hhamd\in Siatement + Threw, Any codth 5 dtry~ nally , bye cadioh ~ fmraly ° $. Checked amd wn- o Checked & _ ~Unecked srabtchent ceca > 6. fixed srasument xed Tt locke stabement+ tock. K Selection stadoments : “The selech'en statements axe alte lenown as ducivion making statements thot controls he Pegtam Yow CH provide the following selection statement bopoords else, switch 5 coue ih veblecad : The SH statement suecit a siateynent for exectthine bowed on the vane of a boolean txprastow. Tt cam be Used tw voxiaw farms, which ore Yrown belo ss a) Bogle oe witrow” brace Syntax if Cbooleam Expre:rion > stodement 4 - Slakomen t ® Ody stoement + eal exeorts ab expranow evaluates to Hues ; i brace» > Simple te eit? © Sie bosteam enprasinn ciaement t and statement 2 9 Th Cposleom expan) t Statement | Stosement 2 3) Vimgle ih with else clause oh Ctxe) R sraboment 4 tres 3 else a iy fone: 3 4) Th with muliple Unditionc: cH (exp) Au Stoloments ih rues 3 eee Tb (exp ay L 3 ele © creteun ett (b fotses gtokimenb (fh trues 4 9 fh with mmuttileve jpicarcbey hiewaxchy TE Cexpe D : ik Cexe) vy (expe “Statement (h exp 2 is tues ue g glatement s wil (f exp2 false; } ee £ cyatememt vp expt fate, Exam le— Ueing Sytem yametpare Selection siatement t o Claas programs , Stare Ueid mained 8 L } (We pins OW oNear 5 Compote. Witte (“Enter your fin"); Piwc iwh-paxte ( Gomrole. ReadLlinecsys “t (pine agea> S Cominle. write (Enter youreuv") Cwe ins. parse ( Comvle. Readlone(r); ye fcvve Toa) ‘ > Console Write (“Evitr Your expiry eeu"); - Yeore int. pare ( LCongole. Readline (095 tk (Years ders) ¢ Concole forgtownd Color = Camtole Color Green 5 Courele- Writtline (" Succes "5 3 elt C one forgo umd Cloy = Conale Color. Red 5 Cove. wetting C* falluce")5 : _ Seve F * Gwvasd cw''ds Conpole » Writing C* Invalid ¢ 5 5 ue vee voriline CY imvabd tiv") 5 3 - : 2 Ex. Mult ple forme of “YE statement Using System, mamuspace “Mubiple tf t ass Proyrars © clatte verd’ moines ¢ x : Srfing wnyTupur 5 Mme myTnt 5 Console. Writ (" Enter a yum bee") 5 ae - + MyTnput = Conrale. Readlineas Cc regu eT Pome Coy tmpat) ; ce Th (yar 0) c Convle WritLine C* Your no: (03 1S Greater than zen | ke imy Trt}5) S ib Cmytie £0) : Comme - WrteLine. ("Your wo. [oy “is Less than zeus! my Tat); i 4 c ih Cmytwre <0) C Conple WARLINE ("Your no- {oy is equal te zero", nyInt); C 3 Cc ee C u . ey “ Conyole orittLine ("Your mo [oy fs wet equet fe zero’, wy Tot}5 Cc tk (mytnr 20 && myTut <1) C t ne . . Cromgate wortteline ("Yow ne Loh oe Fe petwcen © Od lO) myf)s C 4 c ebe Tb (rym do BO myture 29) L Covscle. WrttLine (“Your he. fo} is in be lo ond vw) myTd}; \ i : XK Swildh shabro ene “Tt fs & contol stulement thet handles mutApte selec by parsing corde! +e one Mh the cece satemends ( within Hs body - 4 Bloue dliaguams & Syntax Quattch Cex prescion) Cose Lonstamt-eypranan - adem emt jump: Stodewn em (defor = Stotemen + jump-stodement | Example o > Oe) Namespace Tmax Movies € Chass “Preqrar £ cratic void Maintd € Selecr Movie+ Conssie . fort poumdGoler = Conble Coley . white Shing MovieName = ™ ‘vd Mow © Naee Choice 1 Comgale Weittling (" select Movie")s “Conpote Lordeline ("4 Menger Aqe sip Uihasue") 5 Cmte WILKE [2 . Tamm wedi Manu 2 "35 Congete. Writeline (“ Eter your cheice') . foie Onavce = thtsPanse ( Comtole Peadline 63), ‘Suite ( movie Choice) vere Movie Names “Avengers Age of Uton 1395 break 5 Core 2s MeweName = Tame weds Manu Returns 5 break 5 Gefoulk: Conste voriteline (“ T.velid Unoice")s Gere Seleck Movies 7 Select Chow « Contole. for eate Color < Contole Coler tule; Shing Hho Times it Crow Chetces Couple. Woteline ( “ feteck chow Time’); Convle- writelne ("4-2 tae AM); Compe. WKURE (To - O2sur PMD, Comele . writeline C2. OF 20m | conwjerworite CY Cuber your choice") ° ChowChoice = ime. Parse ( Conple. Readuinets)5 ze) Switth ( Chew Choice) oO! t oO Case! + Conynle. Fortguaumd Color = Congelelele » Green j oO. Phow Time “= "10730 Am" Oo Concte wrtteine (" Movie Name + "4 ovfeName 4"\u"e O Crow Time s+ YrouTime + "Xe Availabie sett: aoe"; ° break 3 a Case 2: Comtele. Fore Geeund Coley = Comtole Color Red 5 ° MouTime = Motbar pets O° Conte tortteine (“movie ame «4+ MovieName ah yw ° ChooTime =" UewTwe +7\n Available feads = ° »O Sold ovt "5 b qeto Geled dhe 5 COLC3 Contole -Portyroumd toler = Contsleloler . Yellows Mow Times "gropm; C Conyole. Writeune (" Movietone. “4 MovieName &* Un ChowsRnes O "S GrowTivmie +°\M Avatlable ceatts “He fast Alling )5 prec 5 Aebautt + Convatewrittune [Y ve Hew Tne Availabte")5 ‘ t ae Seleck Paew 5 On y Louvle. ote lee U5 Roob'ng Selector *+ 9 sping Comhuue Booty 5 oO Console od Ci type te Check amojhern Mevie, tnd nN O 3 de quit 5 2 Continue Becing = Longale. Peadne () ° oO oO 3 o00g oO Qwites (Continue Booking ) t case “4's Case "N": Gor selerMovie 5 cose “n come SN Congle Writeline ("Thank vw... Vint again"); ¥ Break 5 Default s Congole.writtline C" Tnvalid choice" 5 7 GP Booling cearrow 5 3 oft — seleck A Cabegory = : Oo 4. Blectowes A 2. Shoes - uron Choice: et 2 S Select a produch + gdact o produce 5 le Mobile be ie 7 aT 2: Lee Cooper a Ewer Unefte 4 Erstn Choi + Es Mobile wame : cost + Program: Aw using Syston eae ge YhopOuline Class Proqraro XL stoic vord main (> SdeckPrduck + H \abeek name Conmletler. Greens = Cowie + Foreqrownd Color String produckName 52° "3 int product Ghaice 5 String MobileName = String name =" "5 Shing BrondName Shing BrandNamel =" "5 Compile: WHLINE ("Selec a Category), ‘ Conmle. WuiteLine( “| - Elednicd) ; Congle- WrttLine( ' 2- Yo"); Congle. Wektling (" Enter your choice")s pene productCheice = fr pase (Consles Read linet) ; switch ( produdChe ice) 2 Coled + productName =" Electrwics"s ° MobileName =” SAMSUNG dla Grand" ; Tyname = “SAMSUNG Televigren "s oo es break 5 6 Coue 2 * prodackName = “fhoes"s C BrandName = “Puma”, C BromdNamed = “Lee Cooper", c break 5 Cc Achat + Conyole..WriteLine (“invatid Chote) 3 Cc Goro SeleckProduct 5 iS i { (praacrchorce= = 4) an eee I) Natok Name « . string Product 5 ~ twe Product Chorce Bs Console. write Line ( "Selec the prduct’")5 ~ Commie. WeiteLine(” 4- mobile")s o Conale- Writtline(™g_tv"y5 ie) Compole Wrttline (“Enix choice") 5 oO ProductChorte = inh parte ( Commie, Readline(>) 5 oO Switch (Product Choice) a ie a1 Conpole. FovegroundCeler.< Consele Clow. Gahite 5 product = "Mobile”s 5 Conmie worterine(“ mavite Nome = “4 Mobilewame, ot \wta “Cost = 1ED00"D5 break 5 c Px On renee dcotor = Coniste Caley. WW IE5 c Produce =°TV"s Conie. WeikeLine( “names “tname "Nn" "Cort = S000"); lovee 5, Defawth. Console. WHHLiMe (*nomore product available); ate Puoduck Choice 5 elie ih ( prduct Choice == 2) t Select Pro duck +i Sting shoet 5 ivr -SWoeCinoxee 5 Con sole. writeline ("Selec 4ne product "Ss Conwle. working ("1 - Puma"); Commie: WHikline UY 2 Lee Cooper")s Conwle wWeikine ("Enste Choice") 3 oo0000 50.0000] ChoeCherce = ie partie ( Conmle. Readline crs Qwach ( HhoeChoice) Oo { / o Case t+: Console - ForeqraumdCel or 2 Compote Loler OW te 5 Oo hoes = ” Puma” s ° \e -wreiktline(“brandmame = “i Brand Nawe Conve pew Merk = 2500" 95 breaks Case 2% ‘Comme. Fortquund Color eConseletater. Wes O Gna es = “Lee Coopen”s “4 Brand Nome5 Convele. writeline (* prom waynes “+ Ora fo ° w cost = ROOO"Y 5 a ) loreaks wn eo «CO , doriteLine (ime more woe Fyret De 41 ‘Congele« 5 owoilable "5 ° o gore Sure Pode +3 Sy susit Loy eet Sv meme Sy wamespae Oy PAE mo E Ie using Serccrion seatementt and jump ° Statements - © 4 Theation Statements: Cc for, do, while, dewhile, foreach, Cc Peters You cam create loops by using (erosion statements They CB came wmbaded statements ‘bio be executed 2 number of Cc mes, subjected to the loop feuminaton critexias Cc Ca¥ provides he fpllowing Stodemembs + ! C foe, while, deowhile , foreads, vn | eo? co D> Fer sipteroreny we loop + The Bor loop. exeautes a Seteh statements repeatedly until the c c C qe condition evoluater bo folie Syotox “bor (witobizers; expresion + iecators) 3 Stakom ents Paiking dramend - Ex .: Pivk wos t-te to . i ving Sytem 5 5 Mamespace fovloop : ; eS i 5 Cass, .froqeam 3 ‘ O Stasi vord malncs ° $ oO for (tat fe cio, fee) 0 ; 3 Coneale.Writeline C%C) 5 : ; QO 3 "9 ay 3 Oo £oO ; > fev Ges f2e0sj+4) § cosote torte (" %"Y - y 9 Conyote wateLine C5 S) 3 / 5 Koduing a dlemond oh stax hour the vo. of ite - O : ig used whem we axe Sure "90 Note: The for loop is usec ayion ond the Chocation Counter will wet homage Synamnicalig | 8 © -e while foo The volile statement excuses a blouk of statemen~ CO Lis untill o specified exprecion evaluate fo fabie TE wilt execnte c Ae Stokomemts ovty when the Condition evaluate to rue. ~ Yet Com we the while loop when you axe not sure about the Fmumbir of f4eradions amd he texaton lolmiee may cham qe dynamically, Suntox. sgh Lexprawen) Cc c ‘Stcdoment c ¥: cC. Blode Represent adion + Wlule Lendition) G © nditvonal Lode £22 int (e053 oe while (i 10> C feae OQ Contate-Writeline 5 3 Shak the aan bs A Do- while loops Th is Mwilax to o wohile loop bub emeur ° imation S epatements ace cxecused oF least once, Eve when he oD evoluost to falie. Serdar so t groternents oa eZ while (wnditen) 5 Brock Lopruembadion 1 do & ye a ~ JeoWe Conditien a Gade Bleue Qe © 0.0 Pe we teins do fipeeeuy . Lede : i Congole write Line C15, 3 ee o00.00 ooo oO Convole. Writeline ("No records foumd")5 3 3 Ey. Mubhiplicoton table sing System 5 namespace “LoopingDemo g Gass pogare static void moive) fgety Rumber jes : Concole.write (enta a num ber"); mumber < ‘ves Paxte ( Conpele . Readlinet)); while (i < +19) att = number © fed, mamta, G ed; Comme. Wriktine ( Toy + bb = Cat eae eee @ ae-osir “The ums staktimenkt iA program-oxe wed te ship the counters, teem oO |. ~iminakt phe lode amd make the Code wart chable ~The jump stokament keywords axe: , ‘ : Goro, default, oreak, Continue, rewen- c Kopoord “DEP d) yore Redirect te omy specified location in Prequans C 2). defeat TLndicads He code 40 execute when cose Cxprerrion c ‘ doen't matth. with case thing - aoe quits he block 2) Cowhwue, Stips Hoe Counter ma 5) fakwun Fee aces ae aan aerwens uoreehoble code Ex. Using: Umiinue ttaypord + Using, Sraterns Memmespace. Twp Continue © chars program © grate void maint : © ine feos ; dot 7 tats c oO \Voreek) c continucs C Conpole. WARNE ads C % while (fest) . q . q pr Te wit pwr 4,2 24 6 7 49 x Actos. . TTvdendudions Awvays im Programming. axe ued to + 1) Roduce overhead +BY string data sequentially 2) Reduce complexity Arrays will wedter overhead by ollecaring memory sv a ceq- euenHal order. And they will reduce tne complexty by Gove ae multiple values nde frngle name- k Drawbacks of eras Array axe hemogensus eatlecto of elten vents 18, D Aeray wre comet be Changed dymacically . a cam Nave a calleckon of same tyre of elements G@. Howts overQome the problems with Orcas : Sol": Using. callecHons CH Se Poreony dimenvions. Arrays are wed in Programming to allacase. memorm based ou the dimentions fis allocating fer values Ahey axe Chastibied into fowe types : ty One dimenconal 2) gx90 dimention 3 Tagged romk = dimen hen | 9) Paxcum (Poxawn ee array) HNote = Square race CJ», 2 5 Thee axe meta Characteu or wilh chaxaster Used to define vange (roo , columns) hic por avalide % wWindso s aK tee th UNER, LINUX. # ~ mamy yoluer 2 a Gngle Character — Ex in omd dir Pad T+ wi give al fhe ends wlth 2 i Ko mers Dynamle memory ablocestng operator a ooc a oo Oo 5° 3 Oo 3 a oo 5 9 3° + One dimension Arrows + prone dimempiow aveoy allowte the memont for values fm Yingle -yow ov columw - a The defoulr value ber indeqae or0y will be Texas for bool, rare amd Shing wall « + Evy clumenk in am array 1s tontidexed as om object LHemce, jury axe collection sb object +The lower bound velue of cura will be alioays 2ex0 amd > fee hound value wilt be one jess than we Wee . e elanrents umber 000 eoooc]e O ° °F aw woay axe Ate accesible by the tudey 1 A one dimemgion axxay provides eo majer attitudes. 0) engi --Rehuns axray wee — Ca-length) Rome = Reruns quray dimension _ + Syorox + paratype] Variable name = now Dated pe (xxl c O Note: neo fs dynamic memory allocating operator Ex ‘weal'] DMewo m4 (als £ MEC Tas Twr dzes Comme writeline(” Emr Ake Hee of am orcas," Vze= wk Passe ( Congole ReadLinecs): gait ed iul Cire} yA A= wew ime [size]; 1 doe ( ie i t Comroles writen (" Exta veined “bor [fogs iin! 03 Se a length 4 (44) ACit = fuk, parse ( Convole. Readtine (9): j ‘ Con@le. Wetting ("Your value axe 4's for (ink is t Counle write Cacid + "Ne" y; 3 j : Corvle. wei ine ds ‘ 4 (etre ot) Corte write Line (" axxoy fs {64 Diner con’, a Rams | 5 ooo oO ° oo000co0 O s we Crtate am oxtay to xtad and print names ave Babee wo. 3 : weit Extor name | 7 2737 c using System 5 : c Namespace “Acray Demet © Class Progeans ie Stodic void malwed ‘ Swing DI 3 : We prey re 5 Z 1 Konevle.s WriteLine(" Enter WUMbOr of Mames’ fo prt") 5 a Gres tr. pase ( Wonyle Readliner)s Coe Oe neo Ap ey 5 c for (ink tz0 4 Ce as itt) oO £ c Compobeeariteiiece Conwie write (* Ener name [£03] + o ATi = Conqle- ReadlineO5 3 c Conale- Oi FeLne C" WNames are +"), far (204 1235044) : vy Console Wri rele CiD) je ER C 3 . Comme - WK Une (> Cc 7 ° y 9 3 ° o00¢ *« Printing mames {n rweue order, Print index, fee sorted « 5 % Array Cassy Array class provdes aset of PrPAHe amd methods ~ to maw pwleit an axney , whic includes Serking » ORY) searching, ° eke. peal a oO i | Deeripion is ]o 4. length Petwns ortay Are Yo ° 2. Rane | Returms axxay rank 3. Sort | Sorts ascending | 4 Revoue cy, sorts descending 5: Trdex Qo: “RI the index numbers} epecified cLument | ~ 6 Dedex ae LoitIndexotey | Returns tne last octuxamnee of specified elemne- oar Mm am aay. Mam azroy. : | | 1 Cory | Gopi array elementt fide amotner- array. | | ee | (| 8. CopyTeo> | copie pom current axray te cpecified army. | PF te to create amd. sort han Oper Ouy = PRIS Dow vepedk yourseba. 5 BE: Sorting annoy» ; using System; mame pare Array ol emo * Cots Proqrare private Stodic Vold nsaiees Getlae (String [J dite © bse (ae Caos te ties. Length £ Con cole -WrikLine ( tHe Cit) 5 4 3 ooo; an00 ,000 anaAAnA stoic void mained @ L ohingh] Gres = ne Shing [ug Fn chennai” > “Mumba”, “pea, "Hyd" 35, Conpole OA Une CC" Cee you emtued *"); Geruir Cahe) u Conple - Wrtline Ci gta Sorted (D5 pocray Set (Gerd 5 7 Getin ‘Cokes Conple-ateLine ("Gites » Peverged + Arvoy = Pevete (oer) 5 Gout (tte); 4 3 3 amoth er ares = OPY & Dynan colt wryng te axxey Ao => CONTE Srstoly Copying axxay t — - R Cory element? of Om array iho another axnay & using Sysiom ; vawnespace Array Demo i Coss {ropa t gatic void moinos sing TJ mamess 9 ner? shing Lg Tenn) May, Steph shingl3 finakNavner s meao sting [memes lenge] : Array. Cony (names, dnolWomea, names Lengthy; for (ine (a0; fe = Mame Pralhame -Lem gt » i++) t Cone. Writeline (Final Nome ['I)5 3 s 3 5 era ehomends In Om cnr on{ ere both the David wales wring, logic Th iis OF be \ shun te Yrowld Prk the Hom found of index | & 2 10000 eo Ex Searching fpr om clumew fm arcoy’ &) Tndexd$ = frst camer % LorpindexOf ¢) finds lost occurance : 3 Ex. A= using Systerns Nam espace Pore DUWo t Chas Program thetic void man C) © * shnglI names = mew Shing | ] & “Toun", "David", "Qrephon "4 ° Sring Search;e Rees phage ~ ‘ ie Conniewnittine (" € ey 7 Seaxcho—Corynte wattebine, _ > seaxch = Conwle.feadtinerss ° + LC Aerot Tad ex OF Cp Rom es Seaxchd <=-!) OS i a Conwie Wteine Ch Name Nee found "35, Ps 4 . 5 . - eue : ‘ : ‘Wort ae Compare sortenine (“ pome Pownd ab Index shes 5 4 Axo -Dndexok (names . seaxch))s 5 BJ a 5 ke “Tables axe wed te gree the dota in welattenad vere os co ® Double Aimenwon ucay: COA, double. dimention cuuray. orger7e ivigrrmodion jysto mas ‘ omd wlurons: You con Ure a double dimennen array to Cc wtad ond writ value Wo a tables, © Syntax: : Doddtype DI VariableName = wun Dosuryppe'[ Prosre. a : c eu | C ke. Rot oe. CS WL Da = mew int [2.3] ghe20303 fui, conts Cc 2 i 2 © ae t{ el = | | c spe ys 6 sh ave clous D) GetLengin(o) = Refwrns vow Kre DGettemeth () > Returns ecolumn Aze YRawe 3 Rorwuns dimemmon , it Canb& CO Ex. Readtng values from double dimemion aeroy. iova. c using Septem Co mawnespace ArvoyDemo ¢ if Gloss Prograns 2 peste void molnen ir CY ae new wt(2,34 . ‘ Lie, 20, 303, ; (ko, 50,603 35 fev (ine Coo 5. CemaGerlengtn (oy 5044) Yor Cink 22s 16 O- Gabon (9 5 44) C 4 Comte weiietine. (TG FTE" MDS 3 Comyele -Wortetine (45 Commle write line (" The axtay dimemtion “is GF" aRaweSs p 4 hee 1 Bei Riad andi Weite Valne of & double climenyiow arco | #2 aging Syston 5 Vawmmespace, Arroy Demo te © clase frogians Stasi Void man t luk wwh2e pcolze 5 en wr CJ a; Contole- Wr (" Ewue Yow gre"); vowsize = Vuk, Parse (Contele. Read liner); Commie vorite (“Ewen column We"); colize = inh faxse (fonsole. ReadLine tr), ‘as neoink [rw He, colgred if for (te int 120 5 (24.GetLemgth 60) sce) £ , . fox (int J20 5 f2aGettengun( ads j++) £ Convert. ("Eyer volue e003; CIs" GL)s ali, Jr = tur. Parte Conmte. feadtine (335 3 Congle wring (user Your Valu 1) for (int G20 +, (2 veWwHTe yard t apy Cot J 20s 72 colezes jae) ( 0 ON0O0V00O00000 0000 ® i wowwle write Calg i]s "ve, o c 5 CC Compe -WHtlinedss c k ~ ei c c 3 cK Tagpad arrays onroy of arrays» a Collen of sere ove dimentonal S + Looks (ike 2 Collection of wes b columnc ie ' + Eveuy ww is one dimentionad cS + ewerny ww fe Melepenctent Vet Nnked ; Column wre must be declared apa ti + Asking Jor cach coduenw (Tagged array) Mubtiple sting searching co Tagged axxay:- eae o wow : A Jagged axxay vs collection of geval one dimer rd Th is alae kuown annoy ot ouayt TA save the momo by auwcaring valued pyro AeCreHE ALLE eM (Hit in Sequence) Syntax Daseryee LILI VariableNome = nus DotoType (Rows eel (Is ro METIP] a= neo tw Es](7 5 . O Progqeanm -. heading valuer few a qegged axxoy > uwing Systoras womespace “Tagged Avr: t mat md Clos Progeans © static votd maines t WECICLa= new int (SICa; A08T = wes imepay { 10,203; re aC} = wew MECH] 1902; Ol2]= neo imtCld £30, ho; for ie Cfzo; x ee Gut yoo; jeaciy, Length tea GeLengin eos 5 ee) 5 g+t) Cconle. vote Catiitjy + yer); 4 Console writtLine (3; 3 Conwle-onittling (" Ava. 18 fe} Dimenvion |) a. Ranked; 4 5 5 oe Poxam Army ( Paramerr axror) rwithd reading om annoy we Cam divecty for he ete- ~Mendtt wie the wmerhed. by using lxpoerd “ params", BA paxewn auay {so paramece axxay thar aia! yor se pass He clament? th an axtoy direc sto The vod ed we poxomesort . Syntax ; faxcams “Sting LI Vaxtable nome 5 aoe Bet tropa 9000000} One) 10.) CoOo°o Go Oooo Oo gq0000cCoOn00 000 * oo60 Oo O06 ° a 900000000 Ome) ( yng Spree; mowmapace axa Array Fleas Progrows ° crest Verd moines B public state void Printlitte (Qacams ‘emg Cy ee) Lo dew (iv ied, Cela. Lengin.s G+) comsoie- waritelin e (aut. 0195 4 3 Srasie void moines t Conse wetteline (Marne axe t')5 Prk Le Cpa, “gunn, "Dawid Convle. weiteline (~Citter axe"): PLE ( Cheemas " “betbuits ®) Oors POPS: Dirccty imac with the hoxdwanxe C, Cobol, Pascal , formm . OS oe build ustg there Lanquages Elechowe devices ore bwit using pops WU net suppert dyramle memory abecahon. OBPS + c@tlection of object Do Metk support inhestomce » polgenrorpiviin 1 Code reuraloi tity » 2 Applicadvons axe (er weit, Apstex eat y. + Uiqud weight pleated with ether propam +t TavaScwiph , VBScript , VO- > Plug amd play QOS : Tamduced iM 1Q60 STMULA 60 1470: gmolh Table «(Try gare— mvc) 1410. CHF + 14qQo - Tove + dpoo0 - - Nee long Kavavtages : >'O } oO ° [e) Oo Oo Oo Oo ° Oo ) OO oOoo0o0on 2 Oe Creating, and privding elements in jagged Gray. @ is using, Sysrun 5 namespace Tagged Array ves Class Progra e Stosie vor maine), . Oo € ° METIC Tas new mele lI: °O iuk € 5 J coluwn, bo ° for Cine pce a Leng 5 OH) Oo 8g : mee ° Conwle WriteLiv & Cy Enter wos aluins LOU", os ° Ge iw sparse (Conmle. ReadLive (29% c ateij= mao tut tells : a . es foc (ink Fz 05 Sas L Bae (Jelength 5449 } faciagyis jure Paxse ( donite trad line (5 ° 5 Boe (Gur ew = 0 OW Sa beng 5 yee +4) ° & ae foe Linder ty toler 2 Yor (ink C205 Cea TT Length she) o Connie wort Ca UMGT 4 "MED B Com le wre OS ° % ° i a 3 ° : 00 o0Rs ne gO) Programming Tat 2 Ty veal world application develomeny' thee — axe Hace types ob propaimming systems used te develep Apu. 5 rcations . They axe : , al Y) POPS ( Pouss orien td Progra mining eystem) 3 5 aopes Cokjed based programming — gystem) S 9 OOPS Copjecr oremted —pargtammnring system) oO tutte ceverad ste atk. O yes is divided 4) pots. “In pors, the main amd every task iS denokd a4 © foridton . All funcivons: are jwreqrated with rhe malin task 2 Ex. C, Pascal, Cobol: yeack 0 Pravorerages:D Suypere tow level features Hhat allows +7 vee : iv} a pith hardware divtoty 7 J S 2) Applications are porte and portable * vel 7 Drawkaks + 1) Lebe Lacks Security - 2) lacks dynamic wnemory | alo codon Co 2) Nek entendable ond’ will nob Suppor the reusability @ owes ; Tn oprs a wmttractions axe controled by using skjeds bur they do not support | exteneibtity - Ex. Javascript, V8 Seipt , VB, ete Advonda ges . 4. Reduce overhead 2) Reduce complexity 5 ie ayn OY Drowbadk ; Hii) not Support inberron amd aygname Poly ~ plate 2) No wade leva Security 000 BW nek guppy re Octemsibiliry Oops: Ta object oviented proqrammng cyaiun the warn tak vw © divided jin several cube tasks: And evow subjeute if sndepend. < em and indivivikal sn junctionabity. Sex crt, Tava, MI RET Languages e we feadurtt ol oofS C4: Cede Pensabirity 2 (ode sepercdion YO C & loosely coupled cmd Extentble ardvitechure ~ 4 StPPorks Tejon based Application clevelapinemt “5, Suppects ea Ok hyper of Poyamming ond Teting Approaches c Stuairy i * Cw Drambacks of oops: 2. Requires Lange onmoumt sy memory | A 2. Compre | 3 Cowk directly initrack with haxdarore c © «A Choxactou'srir ef oofs + 4. Coss a. Objet B. Encapswosion 4 Tnbesitamce CS. Polymorphism C6. Postwuton Cow Clots We group oh attdouter saith walasive behaviewr bape into | ‘ a Unpe Ut with a permitted accestibivites is known ou c class - Dt) Te fe @ mode tr blueprint for an sejet crtading om of : objec c 4 1¥ i's a logical enhity thot albews You cts beep alt cute - ma rake @ GnGe wv» Yq Th isa user defned dotatype and wet @ managed dais! is a rthecence type - Sytax: Coss className Dyer . ¢ members hemce, to hed jdpat g A Object + An object is a reference of its class blueprint - Tess & physical representation +e dors Yat cari access Cass news b- ~ Od by using the opecatot dot (). ae Syntax : < Classi name >ecvef_var > = new C Tatgs I); Ex: using System ; »,OOOO0K00L0O000000000] Namespace 00 pDemo tie Gass Produer £ 7 3 | public Sp tut ID; ne 8 | . _ | Publ’ sting Names A ublic double Price; ~ | P a Pre 5 3 Chass Proytave § ssahic vord maine 2) t 1S) | Produc Prod = wer Produc (> 5 5 prod. TD = 1; a) frd. Name =" mebile'y pred. price = 600-56} ; Congele . Writing CUEDE” + ped TD + WW Name or Pred. Name 4" XR ES Price ae prods Price + "NED: $ lOooooo00 * oO] 009000 ANAOND000 NANA AA nona oo0o090 C7, BU\d the clout A Cosa axe te locaton whee data Is logico save and Ahoy axe Ubraxie. * Creating a class \ilevooup 3 A Lbrany comprise of collechion of) Claiser, it ic a ~euable assem = bly thes adlows You to access -the member rem amy ofplicodion £. Open wisucl Studio qote Jple menu. “nue project” ar Seleck wowed CAF 2. Selec the Yomplose cous Wovaxy Project. 4, Name Ho" employee Reporiteyy” 5. Add chost iw the projec by mame employee -ce 6. public chose “Employee g public (nt Employee #DS public string Empnames * puslic double salam ; % Virray project" Chd# Shite + 8" Be Ths WN qemeroke a dit pile - * Viing dass ibrauy Ma contle Applicatow + A. Create a new contole application 2. Biyat Wide ow rektremens amd seeck add Teference 3. Clide browse bulton omd seer he " employecReporit ory ADL" yile DIV..\ Emp loyer Repository \ Bin \ Debug \ Employee Reporitory DU A. Goto file" frograin.ce” amd write the following code - using Syne 5 Using “ employee Repository ®s Mowrtaqace Dem kepplicod ve x & O Ua Program : S cera oid moainc) 2 t rok Employee emp = naw Employee (3). Oo emp, Euployee ED = 1 5 nuke ° Cadac Melon cd, _o » Salary = ets 16.4. O cmp ny = 450008 CF 5 emp: oo oe i Commle. writeLine( "ID =" Employer TO NUN" Nain 9S” + emp. Name at "AK" 4 "Salany =" + emp Salary yy 0 Oo 3 oo 3 : oO z a) FH vahile practting hoo methods + i ° 1. Create 0 closs erany prjeck clirey amd by Giving © ° wu ME CaM access HES class library project = " : , 5 a a ‘ five Mw Vb Nawe " | wre Mens prnjed. using Wamespace “Class awe : 5 2-Crtade a clas Wray Mo a current praject by adding Oo | wed projec. cwect “Add” 4 "WE projet” amd celeck 9 ass librany and qving o& re4erence ly igh clea oO ° oeence 3 wuew ~theremces and acces in Same zo project eg #& Methods = 5 exes, S ee jee e ex NOt, &) 3 owes 9 Red 5 Properties ° ° ° a00 — He Y Mathods § Methods oxe actions Performed by am object @ Th @ ser. ot code bas +o be wuut mom Opplicatton rem you Com emcaggulake the code ivte © Method. So that you Com Syrtax s Call the wethed ‘fuam omy locadvow iM the opplicadin. srat’e Method Name C Target) 7 : Vo bedy oh method. Kynar of wasined © £%& Grtading a wmethed fo print numbou + C 1c sing, System 5 Momespace Methodsdeunro - t Chous. t Pubie vard Sampte Print nwwbe UO £ fpr Cit ist 5 fe © Gunlewowiteling LO 5 by 3 daa) Clas frogram £ “grate void main cd z Sample S= we Sampte ©) 5 S. Punt Number O35 nw A” Static method. a. fer srosic, memory is aoc ~arcd amd after uring amd Fhe memore wit be dutoryed » 2 Eien me create new Wa urn ory. weed intbener L Ren-static metned Memon wit mor be destryed CFO When kumction emds ae duly ence crtad arrd wih ren Hi we lose applicaHow gronic ™ tthod 4. TA allocate wemory and xt TWe the wemor, HN the OPPKcotion gate 2. Memo once allocated 1% wil rtmain undertmyed CVA Whew the kum cron end closed 3. Tk donot xequire am instane to call we Com cot tt uaing Gass wetted Name, MeHreditaue « Cieus Name . method Name CS ie o Sample F005 Fo is Stadic ® StH C Mettrod « Non- State method. ~ q.t+ alle cases memory oma de after wing sk dutwy Ae edeing memory. It. Even time re will) CRO O WUD MELOY Toe wcase it destroys the wuming ier using 3. Tt require Stamce te Ao acces Fhe welneds- Exe sr. frO + Ty Fr is won Stove. First we have + create an object Ty the, wren, is Stogic Hew rhe, weeny is crtaed and the Savne memory will be ute for amy wumben sh instances - Meme aie vase will vemnoin Witthod Ends. emetant wurwhew wre 2-The starve wethneds ace accessible Breaty Wy wing dors Mame Syaton public stadve void Fumavencs zt whembens ; 3 Th a wethed is Atocatea or every instance. a The non clatic methods axe Cobject) Homer they ace alse bnew as UoK- Stah’c thea the Acces gible vaemony 3f Mersly bY AMKg om Moamce imstemes. waethods » ° public void Fumetion ¢> ¢ g 3 Ber uving war Syston ; mnamerpace Stodic Meme v c public claus sample : : public wk public static ie Sy Public void FC 5 go. - ¢ ony c 3 Public ver static vord Fel) Sestis 3 c public void print cd Co £ oO Conwle. writeline("{2" ai 4 “VET 4 SS 2" 4895 Q 3 oO 3 Chass program q grotic verd maint) £ Sawple Sis nero CammpleO 5 st. BOS Sample Fat) sea z ase. PriwhO)5 3 . sompie O5 Sample $2 = neo G yee oY gi. HOS Sompte + F203 c Sa. pankOrs a3 w POXomertd axe defined in Wanaruxe *# Arvquemente axe patsed while calle the wethed B Pormal Paxomerer ° A Actupl Parameter oO ' 5 wy AS SF nesneas amd paxamelers : cs “The method are Clarified ite 00 type: 7 4+ Parc sex ers a 2. Parameterized - 3 A faromeaized method allows - change -he method o jumekonaliy dynamicatiy Syntax e Public Static vord MetnadName C pazameke) ie a we foxarneders Amd axrqumemts = 1) The volmer that axe passed wt the method Hqnature , ALE Known OF Parameters. 2. The voluet Hyot axe passed fee @ method while call Xhe method axe mown as arguments. DytOks suv state void WethodName (ihe) fasam eben / xg fermot * 3 Paxomerer, ClassNawme . MethrodName ( jo) 5 25 5 arqumem t/: aumal paramerr A Tt {Ss mand obey Ey. Method with singe parameter Using Systum 5 i pub\e static void “Printvumbey Cit w) t . for (ime fe yiesn5 Ge £ cgnenle weietine (5 7 3 3 * Chass Program genit vord maint) z Sample. Print Number (29) 5 5 Kk Methods with muttple parameters :- c A method cam have wort Hoam one parameter at Jormot c Parameters “These parameter can be of Voriow ypu and Khoe is no onder depend amey . pacar tens . EX Uving System; Tammepace — Paca- Metnods fe Sas « Ewployee. ¢ ‘ Ty a method Ys having wuttiple parameters thes the axquments mut be passed iv the tame orderek femal c public stone void “beedls Cint Td, Shing ‘Name , clouble salary) | , \whe “Salary =" + Salary >; £ ne Conse + loriteline (“1d " 4 Ty 4 “MMS + Name ct En Nome’s Class Program t grotic vord > mano t a » Employee Details C tol Toh, 4 S00. 60)s ; i 7 3 D 3 S Ke Methods with axxaytype param eters : voA method Cam we Guay type fartmeer - 2. A method com have more than axeone roy hypre Param ctor 2h wethed cam have axray Parameter along sith other Yomak parameters A. There is he ordex dependonay while wing a qyuwry par som eter along with ere parameters - 5. fe using Systems - namesjace Medndds ‘ y | Claas Savpte 2 | : | Public Stabe void Primt (ime, size, string C bist’) 7 . +) fer Gne (205 V2 Ist length 5 OH) 2 | £ 5 Conwle -writtline (tse (iT) 5 i 5 ; 7 2; Comple write Line (“ Tetal ee of Ft ims “+ szed3 as ° a ; 2 | Chass proquans 2 | 5 5 | Static void Mosn 6) 5 t pans”, Mumbal"}s ‘Sing ce = neo Sing, TT @ thewnos Olea aes ( dha. Length, dh a); o A porarmete arrays pirecHy Pass Hoe parameters A QKLOY paxambite = method com have more ana one qusy paxamebex pub Cvly ome, parcarn st, Cy # Pong with pazams with we con have owe othen param eé- C yeu uk the paramere auasy Yrowld be amd mush be Hoe lowe -parameder in fprmmat Patamesere Wst- com Paxamebo array: A method Cam bt defined with parameter “aut Si poxen Khe qunay elumentt cam be divectty passed T 9 Hot ute metho tos -orqumemss a. Every method cam have only ome poxameser ay 3- A paxomex arcoy rms bt the lait paxamneser iv were -ad parameters list - Ex uving Syren; mare space Methods € claus Samapte £ C pubic state vord priv Ctwt Aze, parame shingl] dat) _ yer Cie (07, te ists Length 5, O44) ¢ . Commie. wrkeine (ut [D5 3 Conqle wteline (" Total vic. of Trems!, +e7ze) 5 c 3 ~ 3 * Chass Prograro c stoic void motny) L ' Sample Pink ( 3) “Dei, Mumba’, "yd "D5, ~ 3 a) 3 ke Mekhod contin g : The paxametert for amy method aim be cabled by wig following methods: oO 4. Cobh by Value 2. Coll by reference ° 5 GM by out i o 3) Coll by values Oo Thr coll by value, them the actual paxameirt are not afpedr: O -ed by fermol poxametect both will we their mdividuat 3 memory wee EM ces - o Ey: using system a 3 5 n ‘ Smespace Colt ByVatue 2 Claas Sawmpte > £ D Public static void pric (swh J) ‘ J= 200; 1 3 ) 4 > Clos Programs d € 5 Stakic void Maint) > f£ int feos Sawapte. Pvt (ids Console. Witting ("Cot ad): 3 3 ~ A > 3 achaot . Memon Atocoted ° Param ae Le ]— [ire] cles ) te 0 O format Paxomera [i }—[ ene we Call by Pebecemee + . ® TY Yet cal by aefecema Hoe cemal parameters will be a pyected by formol Paxametens. Bote Ppaxametou will per Ue the Same mormon, rUpecemes « The @ keyword: "TekY must be With Poot acdual © formal Parameten - By, ung Syston; Namespace Call By ef £ ~ Clas Sampie € public staric void Piwt (vek tut jf) [ i 1 Cars Proqrars £ Bate void mono foo. ple elsgepet. 5 ime fd; Varfables Parameters A $ Sameple- Print (vehi) 5 he meanhe da Coumle weiteine ("1 3 3 2 Aduol r= CG parame ele Memory allocated fpr O bet fyrmal arid actual Cc. format : Patarmeser ill be same, r paxomen LJ , G tht Se 200 wit be c Use 42 f be now c % = € beamer fe 200, te Cal by oUt Methods without amy atiwentype Can rebum A volue by using our parameters “The ow paxomet- -OU wusrt be attyned wrth a value betre feaving o the method bal eee abing System 5 Mamapace Cal By oh , & Cass Sample ies & publ’c stasc void Prive (Awa, Mb, ow (mt sum, ovr int proud) £ a Sum = O+b 5 : ° prouds arb; a 2 3 Class Progam 4 a ‘stork void mene) 7" wo omegang 8 - Sum 3 Eowrste -Savple. print ( 10,20, ow 5, owt mw) 5 . Commie womeling ("sumera sg eo \ ta” product = "4m oo 3 A How iwieger type method cam vou a siting 7 4k Methods amd vetwentype i — A method must have & rerun value amd if tb is not rw. “awing amy vole thew fb must be destaxed as void Methods wits rdw type axe Wied te vetuema specitte Nolme , Stators publre pakiTyre Metheanome (5 £ Pret value + i pubire ( ok ere tem Weluamre to Cte String Welcome o uring Slow Namespace Methods £ Gass Saumpte Public chaste Sting Prints Usexwame CS pring uname tut Td) c < ERIM Hetty fy Uname + "\n"+ "Toe “4 rd) a 3 public int Add C mt a, int b) £ “UW A+ bs Oo 4 G Gass Progtans t Static Void main i> — & Sample Sz new Sowple ©; Fshing msg = s.Ysexdame (Raj yo!) Gousele . WrikL ine Comeq)5 Commle vortte Line CAaaine $ + B-Add (19, 203) ; 33 & Code Peusabllity i- o Tk ot ome of the waajor radure of oops Mrat enabler teveue 7 feat tede vatthout venting (You can achieve ‘code rewtabs'tty by wing following methods + s Ve Kggreqadion _ ase a «elation mip B Tuherttome . Ts Retodions Wp ° 4. Aggregation + Tris the preett of accecting members tp one claus fomugh “anotnee dass without medwbaliing amy rus 7 wotovwp bermeem classet. TW hype oly elo tana Catv eM IS wthered ab ablect ~t» - object Gmd Hvis eorvonth= XP FS HMown as" Hos-O Petasron” EX using Systems o namespace Aggregation C < Cass Fivsted £ ouevve tat a5 public void vtad-at c asi . a public vord frivk a> 9 t . 5 Convle. wee tine C*A = 4 a) 5 os 3 3 ~ Class Sewnd ~ £ é pubtie vat b 5 publi firck f= wee RvstOos Public void ~xtad-b 0) t 5 F. read-a Os 5 . puriic void Prive (> t c Be mee $. print. BO; Gonple wWriteLi ne Cb 3 Chas Prodeam ‘ & Static void molncy Mew Seeondt 4 © & Tohenitamce : Tt is the mechomiem off oop lanquages thar enables Code reusability and code extentbill fou cam access Me member of one clos threuqle amother dais by maintalning welasionthip beroten classes “THIS 4ype of lotion ic Foon i "tsa Relodtow! Th inberfiamce you Carn creodt neo Couser by cwmplennem ring existing dosses “The neoly created chats js mown o« dew =NEd Sars ov Child dats. and the existing clare és cottad Os base clas- or parent class. Based Ov vaxisw implementation mechorisus imhexitance. Ys Agied inte following +4 : daaelsi fpllowing types a Hinge 2. Mustiple 3. Mubilevel & beech Hybrid BS. Hierarebel inheritence 4 Kage Tnhedtance ; Tn finye inbesttamee oly one deniv— © ed Clals implements cugle bare Clast. so thos Ubing a dent ~ ~ved class object You Gi accers the membor 66 beth bare oO amd decived clas. ° s : C aaa x Cass Base [Base] ~ € °° = Base class members 5 [Derived ~ Cats Deived | Base 9 a ° Derived class members; a 3 ) & UME Systems 3 Namespace Inhexitamee, 7 L So Cass Fiver -) : ) public imtay; Public Void fa readacy £ Beto; 4 public void prntaty ~ ‘ Compale. Write Line C "A=" ads > 7 9 : 9 Class Sewnd ¢ fryet fe £ publec inven 5 Pubic void yead-bl) a ado 5 \ ° Public void pPHonr-bld > t * Congrte. Wrtkene CMe ="4 by; oO ) oma 6 o © cratic word maint) c £ c Sewnd s2 new Seconded: Cc S. Mead acy; c Ss wtad- 60d; c Ss Prin ats: S. Prive b>; 3 i 5 ANIC — Method hiding: Tp thece exisa method in base dors ond Kee wsame method tsalio there is dexived class them the Aerived class method will hide the bate Jars method to avoid tule we have to use “new” Kupoord tn dexivest claw # Muriple inhoditonce fg vot Supported became 3 Where are several base classer amd oly one devved class w Th we want to averttde -a method pwt Muse We Keyword “NR td x To Overridemethod override“ ‘eeproord vs uted * B Commer ovrtdht. method My same chews, A dass cam have amotner dese Create on obje to access oth the classes — % + outer lass * Code Sepaation can be dent Using mustlevel imbertionce © de rehrnervon How. 5 ~ Comveding String to waebos integer 2 ving Syston Namespace Methods £ oe Samapie rene steve ime add ( iwa, futb , Fring “text Atet "spo"; Wr mums th. Parse (text): PAE Cast) +m 5 ~ ; > gus Program 5 Stahic void mah) > ‘ : Comele . WriteLine (1 Addition = "+ Sample add 12,20, “s0"¥); - ; 7 é O/ps A552, A Why we cammet Create objeckoh Perived chats ee - Constructor: Conpstucre wiM call ye baie clase object fish amd ahi i% wil call derived class object Aes) Why we camet crcat® whe object of Devived Class thot Uier the momen of Bate class. SOO + Wevardvol inbestone 4 x06 <1 Wievardiasd inhadiamce 0 wngle base dass fs twplamered by multiple dedved Closes — Syntax: c See Glass Base _— Bose] 3 Class eDexived + ase using Syste s Vamespace Hievarchiat s Class Employee f public feb Shing fName 5 public String Lames pub\e void -Patwk Name Ct £ Conwle-writeling (fname +" “4 L Name) 3 we t Class Paxt Time Employee + Eanployee $ 3 Class Ful Time Ewployee » Cumployee t 3) Class Proqrans t Static verd maint? £ PoxrtimeEmployee phe = ners fadTime Euployce (2 ; ple. Fame = "Ray"; Pre. ANewes ” Kaname” + tHe. PrivctNome (95 FulTimeEmployer dees mew Full Tw e Employee 635 Pee -tnome 2"! Kiven" fie Aname = "Pao", the. Print Naess; & Method Hiding. Ty the Same base class wethod ys wed im a derived dads them the dexived class Method ill hide whe base clas method. Ty Wding is intended then we he kupword "mew", EX Th dedved dass while creating ¢ method unite Whe i £ public Wew void PrintNamec> g Conwle woiicline (fname +" "Fgname +" (far Time)” ) 5 z 3 & Accessing Wdden Ware Cass Method - There are toree different methods +s access bidder bose class Wetthod :- Ae Uding the Keyword base & Clots ParrTime employee » Employer é bares Prtnk Nase 6 Public new Vord PrintName c4 £ a lake. PrintName cy; O°0 .a-O0 2) Comveactt ng. a deiived Class Sbject fare bose chore type. EX while eroding the objec eff dexived claus fm nabs, Paxstime Employee pte = neo PartTumebmpleyee(; Pre. Nowe = Wp, pte. MName = Kumar" 5 4((Emproyer) Pte). Primtname (97 CD Creabing og base class reference thes with the Memon, Ob ¢ sdexived class. Employee epic = woo PartTine Employee) 5 ‘pre. Fame « “Raj” Pe. (lame =” Kumar's pie. Print Nave (9; ; vekpeonee ‘thas utes % Note. You camnot creak & dextved class ome : exived te memory of base chaus- Becanie, jb whemever od S Structor ) doas objeak is Ureoted, Hh cols the bose a then followed by derived loss Ex. Bose olf = New Dexivedes ht valid Deuved obj= neo Rasebys) Nev Valid _& Method oversiding ¢ the procs og ete oad the femenioriah’ of} a bose Class lee method is EMownM Gi erred evewnitivig 2 4. Th amy method is Iwdemded te overxnide then it mut be, : marked as vitriol oO 2 You cam override re methods only from a decived lus, O 3.Te override amy method of bare class You havets Hehe keyword oveuride « . 4 Ex: F Using System 5 ~ Mowmenpace Overxidinng 5 Cass Employee - § , PUbIIC String fname 5 bic sming AWame 5 Public ‘yirtcl void PrintNamnecy i CommlewriteLine Cras pntamed" “4+ intaureds 3 S 3 Coss Parttime Biuptoyee 5 Employ ce. - & e PUbLiC overuide void PrntNamec) 2 4 . Covenie. Wxiteline CFName 4° "4 Name ¥° (Part Time)*)- | C B 2 Class Full TimeEmployes i Employee . 5 a ~ Clots progears D t 2 Static werd mained ‘ ° Paxt Time Limp loyee. PIC= he Pars TimeBumployer () C Employee “ples wes PautTime Employer 05 @ Phe tnlame “a "Raj" Pre. Mame =" Kuman" s PX. PriName oo : FuuTime Employee Fes wen PWu Tine Employee cs: $e. fame 2" Riven"; fe. Anlame = "Pacts C fee. Privtniame 95 A Anjecion O | suwmamespace- A Civusar dependanuy Tajeciow § - Th we hove one vase leg closs amd we weade ww owe : derived class Aller dedving a akewe fp core cleus ,if we want +o ow a an ia is ov lon existing late cleus ai a derived clase ot possible The concept oS kmewn au cl.pendemnc Tajecrion “Y Ry exude" ead a meted, une wit wz wile overriding Apa Hie Coup te tas “oveide. PaviNanel amcl py . ceding with Core + oveh® ond Gap of Be MuNlevel “Inheritance : Tn 00fs tomguages you con achieve Code reusability , extenwbilihy, God Seperation by Using Mmubiilevel ihexttance « A mes clas és ertated that iwplement: an existing decved class> which leads +2 o Wmuthievel hierarchy , Stax: ciars Qase 4 Wembou x ease Coss Takermédiote «Base. z = members, Tytermuediate t Clos Derived + Tidexméd vase (Deve ] t 5 Ex Create a new commle Applycasvonw by Nome “Ahyusl Notes, 2 Bight cick ou project mame in sel explorer amd adel hes folder”. a) Biker » D Caxs. 3. Right cick ow biket folder and select “add ness deat”. 4’) BikeNamescs 2 Mamespace AdyushMotors . Bikes { . Class Bikewame t public void = bikename O £ Comte wrtteline C* Yonda Cbe"> 3 3 4 2) Bike Pett .co wants pace — Aaywih Motors , Bikar > © gus Bike feature + Bikename £ Public, yvotd bikeFeatuntd) A : Console wrklineg ("Age (60 emeL*); 2) Bike Cost.cs mowmeiface AayushMoters. ike & Cost Bike Cost . Bike Kasuces t PUbC Vordh Bike costes t Contoles witeling (1 3 A 3 t, 60000"); 4. Bike@uotation . cs Mamespace AoyurhMotors. Bikes £ lous Bike Quotation , Biketosy t 3 3 4- Simdlacly crate dasser in Cars” folder. 5S. ndrite the following ede le “proqram.cs. “HN System, Wing Aaqush Meters. Cant; VSNd AayuthMotore « Biker 5 Kewapace -Aayush Motors Uses Prsqrar t fom Private static void Select Bile () Liat bikeCheice 5 BikeQ uototion Yrote = Mew Bike Muatation ¢, | Gonesle Writeline ("selec give Date"), Console. Writeline Cy aiye NameS; Console -WiteLine ( “ 2- Bike Feature"), Quele writelineg C8 ge piee cost") : Commie. wWetteline C8 4 ~ AMS a Comme witebbre( "Enter choice). bier Cheice = Switth ( bi ke-Choice) COL quote. bikeName, oO: break Care e quote bite Feature C5, break », CAEL Gyote. bike Cosh 5 break; Cose 4 + A uoic. bike Namety; tonto qubte. bike Featwuest) > quote, bike Costoys breaks 3 Stasic void mein ( 9 £ Mae cho ee 5 Console, Writeline (" Séect @uodesion for oy = Int Poxse (Conile. ReadLine a oo00000000 o| * y Gusle. owned CHM Biket)s.> Conple.uviteline (1/85 Caxrt")5 Ctr Comtple. yorite (" Ebon Moun choice’); Cc Choice tuk. parie ( Wovriele-ReadlLinety)s C Switth (cnsice) £ C i Cet: cclectBike Cy 5 break Coser: CarName C= mew CaxrName cy; : , © foxname cy. . oreak; i c 3 BS 4 3 “te Polymorphisme Polymorplidim 6 oo greek word volnexe “Poly? men: cut may” omd "worpose” ancans “burial! A Huge bore clout rehaemce com: wsei the wena ong ek wap Le ¢ derived clauses, 8* that through, o singe bare clas! object 5 you cam access mudsiple decived clous pratense 9 How 4's Can be done 2 » ~ Te 008 languages polymorphism Ye teemvicoly athe ob 9 overloading became a wingie bare Oa ae oe a overloaded with mubsple dexived clam er memory Recs overloading. iS supported fer — ‘ 5 4. Function or Methods ° 2. Conabucteys #8 ° 3+ Opexators . EX* Single bore class atference. Uthg —memovy of muLnPle derived classes UNG System ; Mamepace fol yDemo 5 Chas Employee £ public sifeg “Name” s Public String 4 Nawe"s Public virtual vord -PrivtName C5 c Brame s * paf dWName 2 0 eeeeaesr Convle . pciienancewrikline(Pamed of bNawe) 5 Coss PaxtTime Ewployee -¢ Employer t Pee overide void prictneme ¢y © Pvame = © Rien! : c ANawe. » Kura Console Waiteline (fvame yom 3s) 3 Chass FullTm c Employee, + Employee fy + aWame 4° PartTimes "y, PMblic overnide void Povtiam e, oO £ 5 Flamm e = Rayesh' ° ANawre 2 "tumor"; ; Gongale wwiteLine, ee “Cha Hees Oo 4 ¢ oss Temporary Bouployee ¢ Employee : £ O Prblic override Yotd frivdNaume 15 £ fame 2 © Rekeshr''s AName. Kumar bs Contole wwe Line, CPrane os wy tName + “Temporany) *); a3 J Chass frgreame ‘3 Stake void moines t . FPL employee = wens Employee ta; S mplovee Dot yess Employee oO: : ployee C42 aes PaxtTime Cuptojeed): employee [2] = mao FullTime Ewplojee CY 5 employee [5] = new fk! Tenapurary Buployee > ; foreach ( Emple a : CEmpleyee emp im ewplayee) emp, PrintName (y, . 8 3 ° : Qo : > oO 5 [® brea 3 Ree eee ( object paar er) Aid Corns. wiklne C obj); : : Obselete: axnethe wethodt which are used te indicate that the following method § no more Usable. ogee Metnod ovetoading, + writing the Same name welnod ‘uty 5) ali fpecems fumctonobty fa clase (6 vtffexed as weetned ete > ~ading a EY sontal methods hate a revlon type olf penctionatany fo Mew 5) “Sead ch creating voxtous types Sh wetted you Cabs Grade & Sngte methed that cam have wuttiple jencio- -masiry . oe EE using Systems (©) (6) (©) omespace overtoodling z a Sammpte | Public vord “Add Guta, wtb) - . e Cougele. WriteLine (+ Sum sh Tuts 2 (as); public void @Add (Heat a, Heath) £ Console. Writeline C'AAMIROM +h ponds = "Ca tyy); $ public void Add (double a, doubteb) & pee Orne C" Sum °6 doubles " Casey): : 1 clus Progam Blac vord maine) £ Sample $2 wu Sample C0; $- Add C10,20)5 S:Add (10.0, 20.0); S.Add (900-00 +, 900,00); i 3 tA Lonstucter is a spedal type of wethod head txeentes cuutomatically fpr evouy insiomes j Gover is Called val automatically by am objet aal allvcating te memory dyynannically . Construcier name amd cos name must be same. eae jU not Comiruckors itt never vk a value, Hemes they wil n have omy woken Hype. be) “Void” Nok mequirtd Consrruder will be cated owly One per am objece Congrructs are Wed to initialize voluet, datubeae wnvech'- “Ooms, pile operatfons amd other Ayret oh aurons Ahab exeote cuneate Congmridors axe chastifted swe dive tyro 9) Tmplicit wonsmuctoy / Defoe umsructor &) EAL conpnuctorr a An Mplidk wnsiucr is Wed by compiler system te IniWabee all integers to ze amd oak to 0,0. amd boolean ayes te fabe- ‘ Ex using. Sytem; namespace — Construct r € ass Dotabose : i a Public Database £ oO Console .writeline (" Connected <5 - 3 public void Tnsetoo lene (" Resord ss inserted"); 3 ! public verd Update cs £ Cowie. writeLine (" Pevord fs Updoted")5 3 3 Chats Progtawe ae L stotic void mas () Daabut db= ww Dotobuecd, db. Tasers O35 db. Updatreo; OoOog 3 5 HK Porometcrized Comthudrs + (Nohure of conser) 2 A consmcty Cam be paxomercrtert of farameruized, We C7 OD Use parameterized constructs order +e conta the ber - roviowe ot am object, Th conser is parameieized the the So uuner ote passed roWile allocating wemoy jor object -@ Ex: Uding Systems Ps ham espace Cowituctort ¢ “cs fF Seomepte Database . : Public Dasabose ( shing DataSource) Conmle swriteline (" Connected ote "+ DataSource); y ¢ Pulic void Tusers 69 . os roving (" Record Tusexted"), , 3 . y ; Claus Proqeare t gdadic vord maines c g Databue db = wav Database (“sql sear ")5 Ab. Taser 5 Commecteds te Sql Sexver Rerord Dns exted, ea Ovcde Rewrd Trtoctad ‘anctomt x Stadic Construders + “The word storie vtseubles Race ao wed ima Class imordern +o aliscate jor om object amd mare the pe Wneme she wemory oe eal available fer aU okt ether — ohje CO Tehheted as compe ced Ex. using Systems Syatic Congru crew Ge TS type of arcateatee 6 ax chitechce ° vrowmen pace ° ‘ lo Chobe Samapte g eo 5 om oO Oo oO oO ° public verd printly tlonvole writeline ("gee “HCH VEE "Set 4s)s : o : o class Program . : C stokie vord maincy ° s oO Sample Sia vee completa; 2 Sie privtios es Sample S22 new Sample C95 : Sa. printer; Sample S32 neo sample (>; : So. Painter ‘i - 3 w When the loss fs protected using private conchricton + e “ar sealed fe 2 HK faivote Covistuctey * A Constructor fam be depmed as private oo thet “ defimes Protection level gor Uais Ty ony chase is having a povelt construde® then it Cannot be wnetan~ HHaked (object created) of Inbedted + Uucing Systems 6 nomespace Halic Constructor ‘ ‘ c Chass compte C € ~ Private Sampiec) Console writting ("haccemiote ")5 x public Static void paurt) £ Congle write Line (" Pier Method ") 5 +3 3 Class Program 5 Gres eid main cs ¢ Samupie « Priwte )5 3 ? 6 WMA Consseuctor Overloading A. class Cam lheve wore than ove Cousmucior tt, cthe fomeH - o cemality of a camttncion com be extended by evertoasting with waurddt ple fenckons calk a Comshuety Th consrructor 1 svertoaded you cam ing the eyovord oy Same Oot ew another Comstrucny by wing the kejoo ais . ring Systems c Vets pace Constructo : 3 S Case Soupre . : He public Muto, bs ~ Pubic Sampie (5 iat“) : ieee - 3 c pPehe Jowple Cit, fata) + Yds (may £ 3 ween; public void pier £ a , ; Conroleroteine” = "ta VET se" 4 e)5 3 3 Chest froqrarns, Static Void maines € Sawopie St = new Sample (to, 20)5 5. Paint (95 K Calling a base chor Commuder pom dadved cloft + eNET feamusork — prowdes ~mentel amd casowized, ved Cah the base Clots Umeinebert (yor Seve you Com (we the pepoord “pare” te Cath nah Oa wu al Hae + eotl CONS TMECTS |, ty ths sttuction we have do chose - bue Closs methods Be using Syste; mnomespact ConstrictorCabiing £ Class Sample i pul we pubke int a5 PUBIC Sample Cimt mr) £ am; oe - gewexal chasses that can be twple-2 Chass Sampled * Sample e . z pubic tw bs ¢ Public Sampler Ctwh wy ihn): bose Cm) © pen; c 3 Pubic void pant 0 Con tle write Line Co Oe “Faery yu = : + beta bys I Cc ¥ Chass. Proqrare “ t Cc Staste void oF Mane) c ‘ Sampled $= neo Samples (10, 2035 | S. Pawo s, ~ 3 C a A ths VL baseter HE Destructor s+ A desmuctor (s speo’ad Hype of wethod that exece © ge ausomasitaly od the tnd of opplcasion + + DatuuvrName amd clot Name must be Samer * Detrader will ne contain amy access sped er and wet - type. TH preoiles with a eld) symbot _ noe os Derudey will exeatt once per am objec amd He con be overtoadid - . Co AL program cam hawe outy ore ceaincton Ext ae BBM E Syateun 5 Mommespace ‘Derhuuer oe Dotabase : “pattie Datebore © e work ne UY commected" 5 Connie 3 pubic void Taser ‘conrmenovikeline C* bt Record is Inserted "95 j WDatebasees £ Convle WHKU he (" @ Disemnncesed” 1 a Coss progam © craste Usid momne> £ Pajabasre sala neo Database 645 $4) Dusexteed 5 Dotabase ara = Yao Databasrecy ova. Thsext 5 3 } OP Lommeded -. Reord Twertcel Coumerted -- ~ feeord Trsented Diswownected ..-. . Diswwnnected - O Fingle operator cam have mussiple Yunetiomabier fll RO 0 odimg Cat suppods Oexator ovedoading te opeator in CH cam overtoad except the following + oo 4 a) 0) (6) 1,000 a Ex Mra, boes Ge105 b=30; Ce fmt as -l0, Wwe b= s@; b=1d A Closst Encapruedion, “The » A Access Specifies .- ~Mch the accercibitity Okces Speayert: Method Widing —Adostraction , hb amy member wy Uring the follesing aeceas SPecbierr ebine accessibility «f membext You con vest ® Access specifier Descriprion. 1.0 Publre Aecensible prom any location ees Axcestcile within the scope 3 Paotected Acceatble within the daxt amd fam o derived clots. eee Accernble Yun anywhere im he pre ct 2. Pataied Tuseenal Accerviole frers a dedved closs im amoth er Prfect amd within the same project - | Care | privote | Tisermot | sprojectd | Projercd toma!) Public : - - = = ae ° x - - = 2 3 = x 4 x x S s ‘ a Case 4; AcceARNA membext within 4he Same cloae. Corea: Accerving memb ex from a Child cheut im the Same Project Case 3% Atcrcing members Aor a now hid date ob Same Project Core 4s Accesting members within the child eloss otsina © Prject - ° Core Bs Accerting membeu wiitn the menchiid close oy anther Project. 5 Coross amend conte Applicat by name oceen oped ie © : We the Jollowsing ode iw "propane! i Using Syaters:, , > namespace - Actes Speci fier £ Public Class Sample * £ prblic vord fC < Conwle wosteune (" puntic Methed" Ys 3 Pyuate oubiic veld P29 Comvle Writene (" bre private Methed")5 3 Protectecl void fal > 7 2 : : Console. voskune C“ protected Method); . 5 Tareas void 4a { : Commie Writline C° Tyeemal Method"); 3 : ae Prorctedtivermas void fe( 4 - x aN Conwle wieuine (" protected Fnstemal Metred Ds oe 3 ook cing Systern; Stabe void Moines Sampte g = New Sample cy; 8-4 095 Sy 35 S-f5 095 Proqrare PHO; P4ao; PR FaCds \ Pets005 P= new Program 4 ; 3. Gate $le Mem and "adds nes Project”, SEO Conpmle Aryiication ond name tt ot “Demo”: HK. Rigi Cuce on ~HEINGA of Demo amc select add oregecemen « S. Select“ Accere Specifier” Praed -Pebrrence Amd Add to Pemo Project + £ Wate the {etiowoing ode Pe geam. cx "ef amether projec. Uting Access 'Specifiou , Names Pace Demo AMS Program » : Proqrarn 5 Sample Static vord many : Progam Pe nero Program ¢5; PHOS P4595 PSs; Sonmp te S =neo Sample ts; SHO 343 we Types ols chases CH te. The Classe axe models or blueprints for cwtoting- strobes 2 They axe the lopical representation sf code and they ote 2 clasw fied into ¢ types . o L. Gremexal chouses oO a. Partial close Seded Chasse o & Abstack Urs ey = fotolly Absrad ee! 5. $yaHe classe 6 gemexic Classes H paxrdiat oss ~ feet SS : 5 © Poxtias close ablews + split He ‘ p real functonabity oh a tingle lous ito mubbple phyrce $l, Howewen compiler vail 2 Compile abt poxtad Casser as a Kngte class, 2 Ths type of development 1s required while working wate ewserprise based emvirowmemt amd templates - + Templars have audoqgenerated classes that wil mot allow ony mamuas change iw ardex to extend tts femetto- mash you coe wie paxttol clots et 0 * Ex. 9 Create a new conte Application 2) Biqur Cuck ww projed hawne in Galt explores, add new ons. 3) Seteck the option 4) Name the fle o “wroduter Cs" 2) OS Tn ts ete the wode > 2 pouriat Class Employee - £ Public ime EmpTD ; fablic String Nome 5 by name “module 2.cy” 9 Add omother Goss fle Portal class Employee < public Shing deslqnosion; Public deuble salary 5 4 D Goro prqram.cs and add the Spllowing wade. Stade Vold maind> zg Employee emp = new Employeecr; CMP EmpID 2B 1005 Mp Blame = “Toh: twp Desgnanons *Mamoger"; HP Salary Stoo; Conpole weit line (+ Emplojer ap =" 4 EumpID, “Name Duiqrodion = "+ Derqnasion wgalony =" Heaery J: et mame, " a OW Seated crosses aS eo Sealed (sa Keyword . O LEA com be Used With methods amd Hoses, + Ty amy method OF claus fs providin fl fom ven ality them it Vs vecemm — amd ne mort extembione gre required ~ended +e max them of sealed + Sealed methods axe ‘not overridoble mot Tnhexitable. bud they oe “nsteb- * Sealed close -le Cobjeck cam be created). ate + EX: Seated closs wsng Syston using System “Diagow rics ; MOWAP ALE Pine Soba anes Sealed Chose Ghtoare © puptte void opem (ching sty t PRUs’ «Chase ($4)5 3 4 Chass Program S ceate void mame € swing sw 5 Sothwore S = new Gypoare C35 Consrlewvtetine (pyrex Progeam Namely. 5 SW= Conmle 1A Readlinecy, Se Gpem Ca wyy : 3 q y Ex Sealed Methed + ARMY System; hamespace “Seed Demo © Clase Sampie . Public virtue void print C3 Lcomuale wrikeline C* Sample Valued "ys 4 Cos Final = Sample - ct Sealed public oventde void print) € @ base-prive ed; Commte. Ore Ome. ("final valet 5 3 3 Cas puoyare Staric vod main 6) £ Pinot = nue Fimo od s o oo 30 900000 Qo0000 * OF. Pros c ey 3 & Absa classes 1 + Methods vofthour , am definatiow er body axe kmowh as Adbshrack methods. . 7 ~ + Whur You art uot sure about the femutionality of. & meth. O eae SE mutt be ‘upiem ted Hen eed TRO Abstr OF Ty o case couaine at teatt one abstrau metned then the © Cass abso wut be marked ol abstract OeTH f$@ yule shat abstruch Method mus be overu'denw Hence, Atstrack methods are alo known at “RULES” © Abstrack chossth are imhexttable. + They axe wot ‘nstancable- bud a reference com be Cutoteds Reference uses the memory of dexived class Using Systorn 5 ¢ MammesPace Atostrmact Demo apsrac class “Sampre £ public vord pric £ Qule. weittline (1 priwk Method”) 2 3 abstract “public vordk Dipley OF 3 Chas Demo . Sapte £ public Ovewsde yard Diep toy oO 4 Cor pole writen’ (" Diploy Method +) Hass Prograre Static -yord moines £ Sample Sz yew Dunotys S. Prive (35 S+ Pivptoy Ch; i yp hey Note: Abstact class can have bot Conentte woedreds -Cesaptadel amd absiatk methods AL Full Abstract Methods Citertaw}> pubric & Abner (By Defeats) Ueme Sytem. Dota. SyCverrs ole Db Bi Tnberhareie gn iniotea is Hw ila te abstacr dat bet contains ply Abstract wrethods . All ‘Mier{ace methods ote by Achowle public and olosiva ch o Tikexpaces are implemented by emt and Hoey Support wut ple inbertianes fe, a nw Clour Cam be “crtated by ieplewentng, more than one fhttngact o Tengaceu camnot have -constructers. - + Teerjesu are vote instamceable bur reference cam be evtated - ~ - £4: 1. Cvtak a nero Conmte Appliaatiow 2 Add ner item ints project = B Selecr Mem Type tuterpacn end name it as ‘Leonnects) owes", Twstrface Poonnection £ void Openur; 5 yerd dles25 a 4) Add amother insecface by Name " Teommamd. cs” intact Lommand Void Inserey >, 5 Oo) wWtt the hollowing wode in pepam cs yO * Chass sq\sexvex + Leomnechion, Teommand o £ Public Vvord opency £ c + Console Writing (Conn eutow is opened “Ys 3 Public void Tiered g Couple writebne ("“tommestton Record is Tuected): 4 preic void Close ¢> £ Conmle. Writ lng (" Conneurion y's Uoted")s j fdas progeaue £ Static vorde maint > ~ t < Leovnection com = Meo Fenn’ Sylsexver 035 Cons Opem(ys tom. Close (5; Lammand te = Yeo Iw. Tasext (55 3 Sal Server (95 3 * "Static fs kepoord- , = + T+ com be used with a methods yauable or a Class or Conftuds) + CasSasic clerser will allocate meron, or thet members © and oll the membed axe loaded ollie ctous f¢ ce = Homer, Static member axe aHealis known ox Class weubert "BE: Static Vewtable clases camnot have (nstonce member * Storie classes one pot inhexitable wembtu axe acce-- ~seible divecHy by class name- - + Stale Classes axe not instamcable they EE ew dors vosovabie fs State” Static ats Sample ‘ - £ Public Static int is State Sample C3 ‘ Stedte inde ¢ 10: ~ : 5 Public Static void printe) < ‘ a Cousole-writetine CO" (ato); Oo 3 i Te access it divecty by Class Mame ie “Sample. printers” # Cplledions im cee. Colleions aye wed to riduce the overhead and 46 rduce Complexity CH provider a huge Doran, ef Cllearons a thot enables ty pore Vaxiows hype: oy Clemente ~ and + Chom qe he Are Ayre Cabins, daring vombine, - Collections © ’ \ [yo Sytorn « Collections Syiem-cohiechons, Specilized — ystern.Ceers ons Genexiat , > Avroytisr 9 Sting Upllection a ality Td > Sade 4 Uitte < © Que ena i cuameare| a # Dicomony are ~~ Hash table * -TEinumerablect> scion > Sorted Lick _ Sorded Dicionary | The uilecHons ore clawed inte waniow Fyre based ow thar acoesribility amd how they store voles. They are + 4) Listtype CottecHons — (towtalns ow values > Ex. Arvragust stack, Quene- D Didomay Tyre wllechon contedne (Fey vatue Poors) Ex. Haubtable . DiGen cu; L ©) Cotections Hor atlow fandorn access. ia Bx. Avroylist, Hoshtoble &) Giteions thok deci’ alow wendem aceers Ex. Siaue, Quene A Sysiom Collections ‘Libraxy 2 4) Ava List 9 Arraylat ss inaplevnemted fparn Syston elle ~ 5 Hore. TLS Tiecface, Ti-is pul to an ancy tout © Cowars various types of cements ana cam change CO the Size dapravieatiy Eb alse provides a Sr ot Pete -tHG amd methods -to mawplate the [ht Sytar : Array list ur = neo Aerag ist (- Capacity 45 Io wh Wemberse hb array Vick Case + [ Member | Description 7 i. Addo) E . | Adds a neo item inte tye NS at Hhevenmd | O oh the bist 9° 2-Lhsect> : Tuserts a weno Hem gy 3 a | in dhe hise 1 |S Rem : ove) Remover Hie Specified clement % ly, - |] 4) Remove Ate) we Nat Removes am el : i ememb by its index humber | ~ 5) Clearcy Removes all vrems from ice 5 ol woo hs ( es >| Tr vetums brolean tue Tp Here echoed j | the \ist DTrdexoFs | Perwens the dex no o% Spedgic Her. Ew | Seis Hoe rex by Count0s | Rekums the totus mo of femme flys] © pla rtydex eh c> Oo eretal eee agate > wesyied element Syprern, wding System . Colteetome 5 5 Manespace Connections Demo 5 t Chass Pre qtars QL Private ste vevd GeHish ( Array Lisp wish) foreach (vor item iy bsty : Gntsle write bre (stem); Conte wWretline ("Tol no. shiteme st Jit count) @ i oO o 4 i stake votd main ic z c Array ist It 2 eo Array lit C5 Jer Add (1010s Jus. Adel ("Toh") 5 7 Abe Add ( 56000-5595 Getust (at) 5 Jus. Taser (2, “Mamaqer. “y5 ot Getise (435 Comme. vorite '(" Enter Tides no, “D5 fc tw Ce int. parse “( Console. Peadtine try, | ~ dak. Remove At C105 | Grewtise( dat)s | C Conve voicing (* prs amy key te vemore al item"); | * Covgrie. Peadkey (34 dar. Ueorld; da’ Grertish (144); a 4 ‘ 3 C 3 B Searmhing yor Cems Se Arroy Ler OQ See) Syren; Urmq Sysrem . catecstons Momerpace — ArrayList Demo t Uess Yroquaw z SHOU Void madnes Aeraylisy Uer = wo Avroylisr( ) oO © schemas”, “Dab, "Hyd" 45 ~ StHhG Seorth €3 ° Commle. write ine’ "Enter Gry Name’) 5 oO Search = Convole. ReadLine cr; YCches - Gootane (seaxohd5 L Comme tine (Cry found ak 4 Gt. Tadexot ¢ 1 Seaxch) } 5 : elie C Coneste voviteline C" Oy not founds 5 4 3 » 7 | S | 3 oO i 5 |B Sack: chock te eaitection hak epruemt tase in fer orn CUFO) fe, dhe lous Mem inserted ingothe jot will bbe the bth item thot Comes ous of He RSA. g O Te ts a WSF type Lollecton thot cloent allow 7 | random acesss 6 memeber in . re | aya (9 Addt ow nee item FI ; * lest I Hero ‘ Phot tHe lott c THe ° g) peri? ghows amd ~emoves Cus ~ DQ Conrains= boy Peete Oy > D Uter OF Bemoving, att 6) CopyTe = Copieh cqition tute am orto Ex: using systonos : 6 : Using System . LollecHonts VOMeSPACe — “Demesiae Oo ¢ ic “Chews Progears a g 7 c pevose static vor Gee ( stack Lt) ‘ tercach ( yor item ew tut) AS £ c Contele. witetine (item ). 7 fal > oe 4 Public Stotie void » Gatount C Stack bese) Gt c Conte. Witeling ("Tete neck Heme. "4 tse coucesy, ~ peeve vord ™MOUHC) £ - “dae. Pus C10) § © Jay. Push C20); © dur . Push (30)5 c Gettise (1s iG Cone Write CY Yow Lx tem ste Vee Pee OI) s c Grettount.(U0)5 Grex Hse (hats Conwic rieline C" Pow Onc Remove lett item 8p Jar Popldd5 . Gertount ( ius) Stack Lit = yew Cradle tos Grek List (aaa) C MTT a= yes int Tur. Com) ; Ae Capt Te Caos Grwwle wakeline (+ Pate, inde mo int Ce in Parse ( Cove le. Readtine (3), Commie. writen eg (aus: 34 we Quere: Gb represent a fin first our (pre) eely_O ie, he Ese Hern (nsedted ths the recon of object | Vier will be the five Hem trad comes ovr of the Ust Tris abo a Wisk type collechoo that will nor alle _ nam dors access f Wwembers » 4) Enqueue : Add neo item ania Remove est item 7 once eee ee 2 ° OpyTe e> 5) Count(> o Sywtax? — Gueme dare nee Quere O35 dst. Evquare (1035 dar, Enqueue (20)5 Coniole. vorieline (“Hho amd -Pemove First Tien, = + dur. Dequeme (>); ) & os table > Hash +table fs a colleation of Key amd value spats based that axe organized based O1 the hash coke of Phe bo boy THis a Avo vey ype collechow thas will ot support indexing. lnd- allows eee of velues | = by. ther key name. cacao + ') Addy 4 Rurnove cy 2) Utorecy R) Cop BO S) Foy (y + Reems all hugs co) Votes) 3 Perrms alt voles, = EX veing System 5 @ Using System Collections ; Thawespace Wash TableDemo £ Casts Progra C £ 3 stake vo'd Vrain (> £ Hattable p= neo Uothtable Cs 4 Wh Add C10$, "Tolm - Manager — 450007)’, c + hte add (2°, David- Cesk - 6700")* c Conte. Wrike ("Enter EDD 5 : Cc ht ide iw. parte (Oovmle. ReadUne (rd; © Conple. wowing ( We CTA); Contole. Wiktline (41 Keys are"); _ Fovtach ( Tah fem im je hit. key) Covwle. writelne ( Mem) 5 3 Convole. WEN ("Values are") 5 foreach ( sting Hem im bk-vaster) : Compote. Wena (ems 3 TH Sorted Mist: This Huwilar +o hashtable but Fieplag: Values im order of thely key. Syntax Sorted ict Lire new Sorted Usters brodd (4, "gehnd 5 dsrradd ( 35 “Mary's + dar.add (2, “davidy: fercach ( Shing item im Lut, Valuer) t Congele. Writeline, (stem), a0 ¢ ia op = Tehn Pavid many, KE Specilized collections + CH provides a library vy tpediized Colletons , witch axe | Stongty typed for Shing valees Thue collectons are dtyned — vender " susiem. collecrions . Spectcced 5 * String Collection + AT+ repruemts a Shonaty typed cotletion of Hinge hor 9 fam change the size A gramicoby, «Tt provider Set oly propecti~ “6 F ) amd rethods +o manipulate the list, thot ax nmlar +o am exo list. ~ Stevrax: SHin i F— Collection t+ 2 new String Collen.) + A RAD ("Tein dst add C» David’) ; ole: . TH wi oceepe ondy swing type Values - fap Sting Diclon ang : 7 Tt is Budlor +0 an hoibtable with the Stemagly tyred Key 5 and Vane , Be uang Seems ob thing Hype vather tram object aye. eos Sytem Colle dtons. Speci lizastons Mowedpace © Strings Demo £ ° Class Pro gram 5 { ° Static void won cy 3 £ Oo @ Sting Didemauy «Lbs neo sting picrenany Os dats Add (“ Aivger f2o/-")3 > “Avs 8G with dee Dota calls “a Uus-Add C“Vedatone'', "Vedatone RED free witt voser “ys Conmle writeline (" Celect Provider. Name :"S 5 Contle. Writeline ("4 _ martet® % Comvle.writcling (“9 ~VedaheneSs Conmle Writeune C3- an OF fexs” D5 Covicle writttire Ui Enter Grove") fet C= ink Passe C Consste. Readtine ¢ »; Switch (2 t Cose 1 Conple.writtling (= wut Catteld beeae; CHER Congote wring CMEC" yodatene"S)s brtak 5 Cone 3 Contotewwitcine (" foreach (vor sing Siem tan lak Vater) £ Quite writeline Cite) . 3 % break | 4 4 5 4 . uf A HK Systews Co Ueations - Grement cs x|Gais is we defined dotatye A Gerace MleHOEE THe oord qenewte aepresemts typer 7 “type sage’ Ge it Cam crease a collection er lous ei or methed that emabler saonyly typed for any specee 9 datatype . ° Ge provides the following qunertc collectrons © D Lish < Types : - 2D Dicrmmary Sorted Dictonay < Ty pe> . LT Evumerabjec TY pe> ao A Lise + Tet ~tpresent a Haongdy typed VS of > ORJeHS that cam be ageewed accened by incl ex. TH Prperties and meiods are Hwwlor te ano List | Uist Vavable = neo Us ctypescy. 3 List 2 srng> Cher c nee List < stm g SO) ©. 5 Chena | "Dashes “Mumba” 3: fo tex each Csring Hem sy dHet) £ Congte Writtle (items 3 Leetraue « 4. Crtate a nee conmmle appiication Adda mu cleus - Fe by mame — “Enployee. cr" ° public “Clow Employee @ public Th Employer ™D 5 partic String Eames public deduced Double Slory 5 a [wake Hoe Pllewing wde tw * proqearn-cs! Using Syne Wag Cysiern Giections. Genedc ) Manetpace Genericlisr £ Class Programs g Staic ved mains € List < Employee > employeet = ne, £ Uist < Employ ee>C) new Employee € Exuployee. ID = Jot, Names” John" | Saloxy= yonoo . 653s, : New Employee £ Euploye, LD= 102, Name = * David”, Salary = 1600.64 4, 33 Conwle Orit C8 Enter ID Ys ink ida fur. Pate C Conyole. Readlme (995 Q “foreach ( vor them in enpleyeet) a 1S ( tem. Evptoyee rp = id) g se & Couple. vite line OULD =" + lero. Beepleyee EP OF UN eerrrrrrrrrr—C*C“ “$EEERD FF o| “ke Dicimany ¢ 4 ie fwilon a hoah table bur Cowains a shenqy typed — eollech’on oi (eo and Vad ek Ex : pismony Cink, Shing > Lures nero prormnary 005 dsteadd (4, "John"; 5 dur add (2, "Dawd")s 5 ee Sorted Didion oxy eee THis Hl + o Sorted Vist except those re bugs amd Values are srongty Hyped Be gates - 5 Sorted D icdiovvany Zid isting > “Ure nero Sorted Ditiom~ ramy Kiwh, ching >(95 [ees Tt is strongly Hyped and -Srerbedlist aa # TeEvumerable > Genexic Interface Tiwtcad of using Sqt quarts we can use TEnumexoble . for Hngle rttord we wmethod Ghqie amd dor aLAPle or Conditoned is given io pregame 2 Te expse: a qeneic imerpace whit up @ ch specie type And otto © 7 Limmaable : C ~pports jtaadion ove & CBilectioy enables fitedng and porting sb dade by wing. “Lan@ * suto «NET framework furm th < 2 LING + + LINO Hat berm ftgrared § . data- version gs. r Thre art different query apreacher fpr dippnent Sources _ Miveerodps ideo ‘5 provde a vingle quem, Approads for ali ype: sh dada rourcer Without LENG. + 2 EE Gueny A> Objet datotource foreach (Employee them iy ‘employees Y (Sem. Deri ‘ . quation Momager") g uo Pu a etatls ——— - q By S4l query + ‘ Steck * fm Abbemployee whe Davpratoncs "Momager ” <8 XML query p X Blew, e aan OF ( Deriguatvon *) value ee LINO Onery: Var ew = tanm vax im dadafounce Syasar ; where _ ordeby ___ Youpby—. Selec vor. Ext Vox xeawt ofrw emp in db. Employees Where eump. des tan od on Sdect emp; = “Mamagen”’ progeare + 4- Create -a new console ppl icat ow 2. Add a Woo Class file “ Beployee~ cs” Public Clase Employ ce Public ing Employee xD + Gate Name; public -double salory 5 4 B. Witt toe Pilowing bode tw Pubic “Program. og’ Using Systeme ; VEN Syatere . Colteat’ ons BENE Sytem Ling 3 hamespace £ Class Patabare 1 Gementes ; Gemexic List g UST CB rloyee > OrPloyeet = new Lect Employees o> L MOO Ewmplovee £ Enolyee EDs toy, Nomer “Tehn”, Salory - coooe, eo4, » paved we Ewployce § Ewployee TD= 192, Names Solary = 60000. 90} woe Ewploiee { Eweloree Ips 102, Names ” Mary” Salomy = 10000, 694% % Ol LOOOO Public TEnumerable < Employee > Employees £ c dead C © suse Bmp cm ploy ces ~, 3 Cross fangram i Storie void Maincy $ . Potabare -dt= neo Database ¢} : Guvle wre ("Enke ED"); twee ids Wt faxse C Consoie. Readtine od 3 7 LENG Query Vax worm 2 Prom cup’ ab. Employ ees wehere emp, EmployeeDD wad Selece ew; Fereach (vox tiem im vest) £ Console - writing, C ; “LO= "+ “tem Evplewerd 4 Nowe =" 4 item. Now SOF MNES Sateary 2 ny Hem, Sate ), ; Ot 5); 3 4 a # Eau : Ty weprsen ay emumerotion , which vs a cotlectt~ ° ow off constants Enums are value types and allow only switqee ype Constamts - They have the ability ap innavze the values bored on the defauth ry previous value. fx: Using. System ; Oo hommes pace enue € enum Dp £ or Sumd ay -0%, Monday esday , Wednerdoy 5 Thusdoy , S Feidoy , Saturday a 3 Cts Broqram Steadic vord maine £ Compote wote (Byer day number") Whoa Ah Pause C Gonmle. Readiness) > Conwle. woriteline C "pay is Ee Conole 3 3 3 a (dayday - writen ~ © O° Monday Vole 2+ (th) Dos. Mending J; W Lhructwesrs value type "A siucuce fs Kyilor te 0 Cass bub with stuticted 5 fenton abihy + asits one repremee type amd traces are Value type, + Gruckus Cannot have paromerertite explicit Contiuerons rc snstamtlabed - . ew | OpruchX4 con be instantiated without uring He @ oper ator : : grrucure "5 yale tyre bub cam be wed al nutiable - gh ty + Stu Structure bud they e eure will net support fuhertbomen ef clases ov amother cam ‘plement interfaces a Struck © Stucuce Name £ wembout ! 3 Using — Systern s hamespace Struchites £ Vwhecgace — Tenployee £ veld Company C33 i SHAH Employee a + Lemp loyen ‘ Public tur rp; pure Sting Name 5 Public void Primnoure ¢5 < Compote. Witting (" Epo" 220 4 o\W Se Name sta Named s 3 public vor Company ¢5 £ eo wortets e Console writting ( Company Waetery 3 3 Urs Programe { State void moines < Employee emp s ep ED =101 5 Cmap Nowe Tan"; Ot PaundName (95 ep - Comp Namecys; 3 ~“ 3 ¥ Note | Shuduces axe Lopfed om aitignment, when a Stuatine fs BAMgned toe Ww vyorobie seuceine OU He Yarn 5 is copied and amy modizcation © he Nem dete wi Nor atte! the original. « Donet Support Tnheriton, w& Delegate: potwrucs 5 oS Pausum) ems h : Deleqgadea s Delegates ake function pointers i> mouny tomer are hoving Hwlar funcHomotity You ca pefwh ale Hie dum © wdriows ~eheremee Though @ gngte atetegare, whe fy wore foster in access. whem compare te am objecr “therenee The delegote signature amd fonction Wanadune mud be same. You com actress ot Hype of tuncavons with rhe ce ey a singe deegete Ess using system 5 Mawes pace Delegaber £ Gass Compre g ho5 Public stabe iut Add (ita, Mtb) a g ~ yen a+b 3 Public hate whet It sub (tra, fur) = £ oO yen a bs 7 2 Public stone fet Muth tuta, ith) > ‘ then abs 3 daegate tw Ma detegate Ci Class aotave ‘ @ Static vord masncs C t My delegate mi = news my ddegake ( Sample. Add 5 *' Commle.weiteline C wa. cavore ¢ 0, 20395 Mydetey ate Me = pens My delegate (sample . Sub )3 Comsole. Writeling Come 30,005) 5 del e = Mydelelpate ws nec My ddegate ( Sample Mul); Grite Writer : “ee (ms. diver (10,5935 & Muwieaittng Cra, 2) C fe Multicart Delegates HA single detegade reberemes Com pets” ; mutHple tunctions and cam aceess all the tumch’ons » then sa fs veyed ab a mubticott delegate. You can We amd unde the dumenons by wing he c Fallnsing operators €at= (add function te delegate) . —= (Wd the Yuncton to ddegare) os EX wing Spiers ¢ mamespace MuLticastdelegate & Coss Sample £ : public vord Add (iw a, ib) 4 Comsale WHELNE ( ‘additions “+ Cated)s 4 public Void Suto (imta , eb) “ Compile. writeline C'Subecbrartous “4 (a-b)35 i pubic void mut ( tka jintend oe eC "Mubtip iotion =" 4 Can b)9 5 3 x Adegate Void Myddegate (ia, heb) 5 Clas s Meo gear t Static vord Maines ¢ Sample s= haw Sample ts; Mydedegate wie new Myduegate C8. Add); Combe writing {" Addition « wt =Nw a Mydeleqase (5, Sub) 5 wet = hao mydeledate (6. mut) ; mM -LTowoke (6,3) 5 2 g oo 0 ORCEC) oOo ° OU ¢ Ovuv dO de Windows Forms Appltcobvons + @ eNET framework provider a clast lilraxy +o develope % vide amd Wah tumeHonatity GUI Applicatvens . All the Clouser of oindowe Weraxy Ore detmed Umden vy | | Ethers. windovos . Forms”. oO Every windows Forms Application tapi ute Several © Cowrs!S like button » 4ex4+Box , checkbox , Radiobulton, LHtBox» OQ Porm, ete | 2B Creating a nero windows Jone Application: 4, Ope visucd = gtudio- 2. Goto fle manu ned projec 3- Select “Visual C4e4 Windows forme Opp ication Oo Ok Applicaton Envivenment © 5 4, Solution Explorer O 2B TeelBor O B Detiqre - Deiqn view - Code view 4. Properties window (fu) oO a Oa) form Control: A form corel ac at stage dor the application O aa vs the b = ica application EE provider Fe rel recent a aieamce at one a CO & Sok properties And methods Aefinedl under System - Windows. Forms, form " Class ¢ * ‘ek + 2 PQpasict Oe iene Gee ene, a Text — Caption Bs Vol dow State 4 Shackpoh on 5: Larw Qordex She C= buwnezefor fe. Maximize Bow rate 5 ¢- RackColor 4. Back Ground Dmage 0» Backdround tmsare Siyte poy o 1 Bleots a- Load D2 Mowectie 7S 3° MowteMove ,.... ete. Yo Form methoola « , ' Chose» ~ > how cy 3 Yhow Dialog cy : 4 Fouucy 2 s Dispose ©) A Musage Box + Tt vhows am alet to the wee amd inshucts the wee +0 cominue, abert ov reirive, The actons of wessaqe box axe Caphured by the mum Aialeg rautt Sato MessageBox . Show ("Message OTe Mets aqiBoxT tors) Message Bux Button s 2) Crtatke a new windows form application, 3) Goto properHes window select “events” eh pee S Dowrble Cuck om mouse chide event ° 9 Wri dhe fotlering code : 7 Private Vaid Format _ mouse dtd “Cohject render » Mouse Event ~ wg, 2 ¢ o Pidleytawt dre message Gon. Hn ow (*cbeing on few a WON hse He window \w Art you wot 4 Sure t | “Cheres} oo ie ° © a Blab: Labor axe wed 0 MessaqeBox Buttons =YeiNo , mesageBoxTun -Quu tion) - = Dialog, Rest. yer) Hus close © 3 eue fue hs | Focal , display He: amd captions that Camnot ke Unarqed rmomiaiy dung the sunt popertien 41) Name 2) Taxe 2D Texrabgn 0 Trage D Trraqe ati ©) Fons DP pudovize 8) Dec » O & Link lob TES giaulax to @ label couhol but Lontotns i Huck Gs hyperlink sothak whenever the al link is dicked te will vedives ty omy url or Pfle Event; Unle Chideed Bo =) Add ao \ink label *? an) Double Ue on link label 1? wrote the 4ollouwmg code- D Sperm Diegraastier- proces A Timer Ane Ser Ht = yr oyem link cLiuked Svat (“cat exe") 5 Cotetator went and WTimeks Timex Lowes fs ued to xe am event at weer 2 dened dime Tweval Th Can be used te perfor’ sche- — vdiled poste. eo A Papert es + ° » Name Oo 2) Enabled — True 6 ~ fptse Z 2 S Duerval — Tr. mili treroncds ’ 5 4 Even}: | a tick. | Eas 1. Crtate a ness window form application 2. Add Fpltowing controls. -~ label & Timer UV000 FP See the Jollowing propertien. Contral Prop ocien 4) Labels Name — Lbi Time Tene - Dec = All Text Mique Midelle cembe ! Ausoize = fave. Tiere 1 E Name = Timers Enabied 2 True foes Tutewal= 100. 5 4 Gore Timex propertia windows 9 S Pouble chee om tide enh event and umite the fetlecoing ode AblTime «Text = DakTime. Now, Te Long Date Chingy C Doublic Wee on Label” 45 open write phe Following ede Lable chick event amd Above ° SY (tment Eeabied = = True) C ~ £ . Himerd. Enabled = Folie ; Cc y AblTime. Tezb cs DateTime. Now. Te LongTimeShing, 1) +" Paused 3; ele it ( tinert Enabled 2 = Fale) £ 8 er. Enabled = Tres e 3 ay . x Ueing label & Timer a, Create a Med window Applicahion a.) Add follosing contrat to forme ~ Label ~ Timert cM SH the following — propaket for cowrls Cours Je Fowid fro pabies Form BorderStyte = None, BackOolor = Black WindowStatt= Maximized Nowe 2 “Label C Artes Audovize 2 fale OC Texte" " c ATextatign 2 idcte Cobre < Decks Ail . Feretoter 2 volte Names Tren S Enabled = True Tereevars Looe ) 4. Double dide on Timer do oper Teck event: TOTS hes mee] £ CD Content Alignment «Taplesten Cis) Comtent Alignment Middle Rigi | CW) Content Mignment . Bettom Cube, Cima Content Alignment, M ‘doll Lee . - aps) tue oS Privose void tment Trek ¢ object Sender , EyembArqs ©) ~ £ te Labelt.Tex ts Daret ~ {We “Now Te LongTimwe String 6) « Oo lobed. ‘ : Tenage Align S (Contr + Aticqaen emt ) abit; O ye used “The bute como! th windows Applicators r iscetlane- 9 +? paterm veenrd actons, record navigation and misce ) os gchons . A propedies: 4. Name > 2. Text x 4 Farstyle 5 Casper ~ st Eves: Lots Gide 2. MouseOver % TexeBoc: Te vs a boric tmpur cartal iy windows farms thato emabis te User to Vp sview and edt the vosues chosing wumntime « L Name 2. Tex a 3+ Password Caran ho MULL 2 Ty 6 @ 5. Wordwrap “6. Maxtung hh = ge7eq ~ Peal Ony A Events; 1. Textthamged 2. have. Ext. Grate a new windows fore - : ‘olx] co Dowble Cce on sextpox tor text-dhamged * evemty» > Solubien Name = Narn e 1 2, Srource trode: Private void Fexteoxt ~Textchanged Couject semder, Event Ary ©) oO £ O° "S (Textawa . Text =» oo ao Text Box2.Text= “cEnter-Name>” 5 . 3 elie - t Text@ex2 Texts Texttoxt, Texts 2 7 Open Leave evens for TevtBoxt amd writ the {sllewing code x Private void Text Boxt £ Sting s = ‘Lextencl .Tect ~ Leave (object sender, LvenbAry ©) ‘S textooxt Teh = 3. Te Upenc w Sool Boxs + Scroll Bart ty windoos fora axe uted te O scroll the -Paremt courol amd te Cnrents horizontalty 2 ~ Ne verstcaly. Cvserates, hSoreny * Progenties : 3. Name 2. Text Volue 3. Min murs OoGo 0 ) Makimuw Bs. Fmodlcnange (reqord +o arrow Fey) S & Mexge change ( regard te mow e cba) BF Gvent = sey, - Ex: 5 4. Design a neo windows form — Coerign) ; > tems {= Tale] 5 RGE Mixer - a & cueeuG pea CO . - oS 5 Nave owe I a * @urol Properk er - 1. NSerobar 4 name = v hed 5 Pinte =! 5 Maximum 205 2. Vsunttban a ens ° a. Nservitoaxd nae 2 VAWE, 5 be Text bact Nome: titlolor 3 Nudtilint 2 Tce, cone Nome 2 tpt Red © ¢. Laban Veme = lot Sample. Text = Sample. C2) Source Grate + Crtate A new method name ‘Gettolor” Private vord Gertotor (3 £ jadue, Extlolor. BlackColor = Calyx From Avgb -(vted «Vale , Voqreen .V , velue. value) 5 AbsSavple .Foretolor =< tetioter. BlackLoler s c tytRed Text = Ved Value . Testing ¢) 5 ¢ Yxt Green. Texte VGreem. Value Testing 5 txt Blue. Text - VBlue. Value Testinges s a WD NRad Sewr\) Evemt : Get Color ess UN Geen serell Events Gerto torts, 7VBWe Scroll Event : Ged Color O05 OY Text Changed . Event Code): : it (tet Red oe >) t - Message Box. Show" Please Ender value“); 5 3 the fo Pet-Somple~fove bolo e tit toton Diackbeter 5 ind Pause ( twtRed Tent )- tytlolor . Blacetelor =z Color. Fam Acab CVRed Nowe , NGrtem -Value, VBluc. Vole) » kbLSample » Ferelotor — ample » Fort = tbltoy Bakcoler; ©. 3 ; 7 *yptoe Multithreading 5 / 4. Mutttaabing . Muiskuking ene #5 the fey fearon of lea. -pelte, usiveh allows tou met than one application oF to pexgorm tnore tham ome talk coneerentty ie vimuttome - nowy ak He same time, . “types = Ty ic chosryed Seo Hoe ; 4) Procets based hou Letrontelad | ¥) Thetad bared Malsitasting System ena Te TT oo Thetad mMukx Semaphore ‘Thread pool Indeloo® — rowitor “Thread Price Man Memory POUT PRAT ‘ low] rn 5 =F Precets Baad Th MAIS! Userdepined Hhetad axe nown ax al “Ymamaged Hrreadu*, _#& Thread ass + — Te prvde a so Ob prepecties and methods to orcas & WOM pw. Haercods. OC ember Ducviption 4) PetThread stat = This Selegate Hot Poin ine fumctione : ye be wed ar fyreade a) Priori — gets amd Set Abread Prlowity, CD Name — FH and sett Shad Name 4) TsBauqound > Pues true ibtnead ie working nw wackg-C Oo cm yeund + oO O sae > Perwuns Aue fe yread 6 loaded ime HE ~ o Yneme 4) a oO | 9 Sra) > Sra the phecad e wMleepo > -B Make the Hrread inactive for epedte oO duration ») 2) Guapend ¢ | 5 Domed ©) Su lpemd “He ttrtad temporarily e [A Resume(ds 5 Resumes toe Suupended Hyrtad . Abe > Teuumninates Hhe thecad permanantty | Teimes + Mlows the Hhread to complere fhe PPS | w Cxtaang amd mama ging Hyrcacds . dD) Reker the fumchions uring a “Eh ead Stat Delegate: SHH Bread cit ts new “Thecadstact ( clase Femsio)s 2) Crtade a Hthrtad tom the kumction Syagon: Ahtad += neo thread Cs)5 5) Sek prspacties jor Horta: Syosset nrme : A. prioty 4) Gra “rhe thetad 7 Systane + Ae, Seek 5 gadaws Forme App {cation - S\Ex: 4) Create a nee aoe 2) Gotv lode» J) Dirngore nosaeapace using System Theead ing 2) Create the following cast Os Songs nore Static void Track3() £ MessageBox how {Track £ popng "yy 3 y wore the following. wde for “yugton Cheuk went We thead € = new Thread (neo Threadsrauk( songs Tracks); +o Nawe =" Managed thread" s ee Or $e StatO 5 ° &Musagesex . how Ci Name s*44-Name pr 4. "proty oS 4 do prtorihp 4 "4 TG Mives ME E-TemMive)s MessaqeBoy . Hhow ("Traue 2 Playing "}, gana Toing: Eb blocks the calling thread uti a! Hwtad touwnaies, whew toreads have te exeade along. with the : Main fark, The vain tak (udeumptt the -Hyrads befrre 2 hey terminate 9 You cam use Join te Hhor the main” Hhread will Jom owhy afin he subtastes - Wing Systems 5 UGing System «Thread in Ynawespace. Demo Thread . £ Cass Database € public ganic void Trser (> 2 £ Conrale. weiteline (" Record Tnsexted "Ys x public stab’ void Daaec) £ ee s Comite WUE (" Record Daered")5 - 7 ° i 5 Chass Paogeann £ Stakic void mosn C) £ “Thread C podabaie -Tnser)) 5 5 “Thread deletes nus thread (6 nes Thread Stack Insed-= new Thread (Chuo Thread Stack , (Dasa base, Deleled) ; thsew - Star O 5 delete Stoxrds Miser. Tend); deere Trina; Conmie. Wi telineg C"Cgnmechion Clete“): “ # Thread Que: Managing oh; Poreads imeduder syspendi- &) a abort and make (& thackve for oO epee clweadi~ -on the spotting wmerhods Gt Wied Fo contol the Jnvead Cycle + 4) SHS 2% Aeepts Sa) Swpendes © uy) Resumecs 5) Aberkid ( ' Be 4. Create a nus Windoos Applicaton 2 Add Rutt Cour] Aevahe Ye aptosing Uode i forms closs » Class Sompie ae sratte vord Privat) * ese Citic ay (ertontte) £ massage Box . Yow ( ¥,ToHring (oy ; a5 Theead. Heep Creed 5 2 3 z : watts he folowing code on Button Cie . Hertad t= neo thetad Cpys Theadttarr Crample + pers) s MessageBox . How (" Cupend Thread"); Supench 05 Menageem. the ( ferume thread“); C + Pesume(y: ) Messageten - Show ("Abut theegd “14 to. Abo 03 3 3 * Beadleck: Deadlock ‘fa qitucion white one thread wot)? be waiting fer amotner thead so ue the process ond © vice Verto Herc no AeA will ota using the Preass | ° You cam averd dts Winestew by Been isu pombe g ads , 5 “The Yollewing Synchronization metheds one avaslable iy 5 « Ctr. a. eng lock (Mowter) 2. Uring MukeX B Veny Sumaphore 4) ‘Leck: The lock Srouernemt fs wed te lock the pros ber areay thread pir is alvtady being wed by amorher thread < Th vy & net memory atlocoson fer the prose ence, the proms wus be von Stos%e Ex 4. Cxtake a neo Windows Application with buttey tour! : 2 (tale @ we oat We ferent ; Clas Somple < “public void part ©) © ©) £ for (wt fa te e385 C44) Masaqe Bex. Hoon ( (To winger); Thread . Heep -(100075 oo00yN oO s oO 3. wate the pileving ok for “patton ick” veut Sample Ss yoo Sample) + 2D a fo sre Thead (nes Thetad err ( eprint); © Thetad te = new Thread (ware Thread Grau (5: prt) 5 4. Staxt() 5 to, Staxtt3> -” 2D Mukex ( Muducd Exclusion) 2 The Muttx objecr emables te Hynchrew3t the -teuk by Noung we TE abready in wse s Te wet the flowing methods te [eck amd Unisce the prowus ), WaitOnue cy Pete cue Mudexts Baricreate fre Saas, Chose Samp le £ Mudie ms hee Mubex0s pubtic verd pint) € wa. (DastOne O95 for Une Cat glee é Mai sogeb-Yhow (6 -Te Hering, aks Therrad, Heep (iv 00) 5 t+t) 3 Wa + Releate MUFexCIs, 2. Bute Ciel code “s came at exit is fer lock. g 5) Seumaphert + Atiews Tis Gndlar te wadex, (cam Lindt the number ok yheeads that can accus the relource. ER! 4. Crate the dots Claus Sample { S omaphere f= new Sermaphere Ca23; 3° pubic void pric) S a ° S. Wait One Os , 20 for Cimt ist ni2eay car) O° e ° Masagepox - row Coe 9 Cy, °O Thread. Sleep Lrouess a €. Releasecy; z 3 z we Buiter Click code - Crtate & Hovcads fem tr to te, the same "Sample print” bumurion”: K “Vhrrad Priovities: Th cpecifier the scheduling priority of ay thread ww Mckuolet be {pllootng yeu eben 4) Lowest zee = 0 2 Bulow Newwale! 3) Nevmad= > - 4) AboveNorme = 5 5) Wigherk 24 He Ania ons der, Posty = stheead Pienty -Lewests fadio buttons allow the user to seeck Qo. ary owe OPHon fm a group oh choices “They work with mutual exclusiov ie, You Con deseket amy. option oly by svecing omother spon > Propentigs : 2) Name, a Text za neces fe Event: Cbecked Chamged: event * AN radios ow & fom voit} worke with «Mutual exclubon +The cto mubiple Carga We need ode. +o quwup thew Cowtainer conurois Vie - Dd qroug bor 2) fomel 3) TabContr’ 4) WplitCovdrod men a) Check Bx: © The checkbox tote! mons from @ Group of Choices - % pepetio: 7 ) Nowe 2) Tee ) Checked ques the we tr sdect mubnple oph- en Event Cheeked — Changed A pt Box T+ is weed te A¥eploy images im pour applicatiow and also alhsot +0 Chamge Hot image Ayrawi cally dusting wun me ¥ prpadta: 41) Name 2) Tage S Azemode . Sheth , Compre 4) Border Style a Syatax: iw Box! “Lynage = i eres 4 t ye = Drage file (HO F\Trages | Gt jogs A EackBox : Tt ys Similar to aseribar control Hat» allows Hoe Wier fo Sled A Value beroeem the ypecified worage of arodued + ew peti Oh: 4) Name 2) Miyimure 2) Maximun 4) VaLune 5) Grol Change ¢) Laxge Changs D Orientation 4) Tice Saye a Event + Sell’ Exs Trackbax and prdure Box :- AD Detigm a mao windsos Application 2» Deignd Oo oo oo0°0 oO omeme) oO Ono) “ie Cove) OMA prepaies/ C1 dPiduxafoxt ay FreukBaxt Trect Austet Rutten 2 Padtopuste + a dfowustont 2 Source Code + popetia Name = Laby Dock = Top Aupowize: Pse TextMign 2 middle Centre fe Dower = PichareBor | FuMode- Cheetos ‘Names TrackBart Vey Minimum! Maximum =10 Voluest Names Timex! Enobied. fale Interval = 1000. Nome = Budtond Tent =4 Foust = wWebding Name = Butta Texte 5 fous Webdings Nome = Radiobtany Terk 1x Hames fadiobudton? exe 22k 7 geen Lead ern code wp mages’ \ card\ Pix PidureBox! « Tage s Tinage .Frombile (@" Fi Wages \ cad\, ANPP Gg A TVratkpext Scovel event bode: : 2 2 fuk Us Private void PO Bart servi Cobject sender, Event Arcts e) x a) te tIABard Value; > String Ph 2 @up \ Teagan casi \” ; 7 MOwebox 4S . Tonage Fenege. From File (@ Path “+ ba Aitg"35 Welabut Text. * Pidure No" + C+" Cantass" - 3 a 1 Vie och. Tick ev ems. code, ° Wake void Hmet Tree’ 4 jet Sendex, Erentarqs e) fea bj ¢ £ Coders brackBaxt Vatue 26; SME Pate = @ “PLN Twnages\ Cours \*; a PichUR Box | | Fmages Trmage - From File ( pasty p e+ "SPqy. Wd. Teste” Picture Nom pcs te Er : FC trecepart +Value = = 10) £ timer |. Enableds, Fate: 4 5 oe : Y ploy buston et code. Hime. Enabled 2 trues A Posse Button Cuck code ime. Enabled « Fatre: = a . oe 6 label Text a Pic No yy “(fasted)” , FF 1% RadioButton CheakedChanged Event Code. Sh (ta dibutent Cheuced y i meu. Treads S000; eo [/ AX Radiowutton Code S (radio@utten 2. Checked) oe Hmer2. Treat = (000; 3 pe bgucB ComboBox 2 li Box ae a S v3 ComboBox amd liMBex tentrols are coltect ow pee had enables tre Uste to Selecr ony one © phow ~~ “Ped Choices 2 Mumbo: DA thems -Add 6) 2 Tems. Rumovet) 2) Dheme. RemoveAt-ty CS 4) Theme. Gowns 9 8) Ekeas Dims. cleart) ~ 9 Theme. Tradex of YD Troms Lisstandexel yo ® Saecsed Dewy 4) Edom .Comntt) Le} Seteabed Ende 4 Bvenrs Selected Index Changes °O &: ° 2) Desige a new windows form _— aD Deine 5 Sdec-a Cosege : . (awry Popping, Caxk— ~ 3 fede: Combrols amd propersies a Couto! Proposes 4) ComboBox a Name’ Ih Corepergien [cee Name > (st Procluck | 2) \esteox s a : | 3 acme! Texts Adel +o Cour 2 D Buston 2 Text = Remove Tem = | 6) Buttons | Texts Geox All §) Sruxce Code : AU Cxtade he plowing tists iw forma clans Lckcsrring S calegerioa = ew Ustesting cy ” Breetronicn", goes : a 9 Ustcsting> decom = new Lincekingscy ‘Sarmsung Mobile”, “Lep TW" 4 Cc List cstring > "Yhoe = neo £ Nike") "Lee Coo 4 CK om load Event Code + c ee Corrina Hern in Cadeqeries ) AstCateqeries . Troms. Add Cittm)s § + IS Codeqeries «_Stlected 4 Index Change ode ; Switch ( tutCoregedes . Selected CG o¢ CC Coseoy Tind ex.) (St Product .Tems. hearts Fereauh (String hem hm decency Mt taodach Bers. Add (item) 5 i brews 5, Cores Ls Products. Trems , heart)» c foreach C string WHom im frou) £ UAPwcluar , ems tAdd Citum); 3 break 5 Ht Add +e Cant butte Clic Code: ¢ H ( et cad Dems. Comains}l tut Procuest Secs Tew ) ( € MessageBox how ("Trem txicti) > 5 ele £ c Jattrs Troms Add ( tatfroduct Selected Tem) 5 9 A Pomove Butt Ujck de? ‘AstCouct «Diems. Remove ( farPro A+ Gat, Selected T4em)-, st Clear Mi Baten chick wde - AY Cart. Troms. lear) ; A” Hamdbing ier im C. O CH Provide @ Vovany to OW Plate driver, dixtete anol ler “The assevulety Kparem ro Provider the cottetion of closer 2 o What ake sequined fs, handing ped 2 & -ro Oo eee Derdony Preeoy taps Ye Seine Divine am sia ae oS I : - Binoy Biron path file Memory : Reader Writer Orta Seay « Dircetory spy provides AU the static eeu as RE EL Porntibole per creating amd maniyutasin ¢ " . * Membous oo eo Get Logical Driver Get Directories d — Get Fitesc> Get CreatonTime oO Crease Directory (5 - Deletecy — Enis oo “A Pose. @ Ty provides a sek of propertiod amd. methods that cam access sthe iuformadion ef amy opecified pile View fe name , 2 xte- -MWon, ete ® Members + ~ GebDivectory Name Od ‘ — GetPlenamety ~ Get FileName withsur Extencion ¢5 i ~ GerPull Paso GerExtengion (5 ~ Getfoth Root (5 : ABs Using Directory class amd path Vor H Design a new windows form: % (Desi —— : aw ae aa Te [ creehater] “ Divecteies a ~ eI =] # lode: “Dy Teport the namespace Sytem. To. Y Case the Piso metheds tm foam Uass D private void gdDrives Listed Berge O “ o Shing [3 dviver = Bieter Diccery . GetLogical privercys ° Poe (ing 205 (2 driver lematy » 44) : : oO eee Tiems . Add ( daives ea; > prvi if 3 : Var veil gern ivs Listes 2 ListBox | Items Ceaxc - i ShI8d OG dive | ° Gebbepedinivents: Ce are en eS CCobapoxt . Sdeckd Tem Te chin, wee . a fo: Untizo. icaive lengt, ; £ WstBoxs, 3 3 = Directory 3 bea) Theme Add (divs C11), : > oy . a VIE Nord get etestict cy AistBor2 . Shoms Cleaxcy Sd] files = Directory. Geteies ( Picraexy . SelecredT tem . poe TeStingl 5) Foe limk (205 1 eo piles engin « oo x p : UstBox2 Toms. Add ( fete 0) + 3 3 2Q 0 2 3 7 7 Fo Load Event: ‘ 7 Yr Deve: List (ay Xo Hissbaxd © Contextmem u Snip = Cove xen Strip ds Oo 7 Combe Box _ Selected Trey Changed event code: 5 PAH GeDirs id ; 1 UstBexl. Selected ThdexChamged. event code qe-Fiies List 5 A Nisreox2 ~ Selected Thdex chamged event Code Sting HleTyre = Path. Gerexkentiom (ListBox 2. Colectatl Tem , TeSteing (495 D (he Tyre Le" fog” gp BETH Pe Je" pagh RW gileType |= £ “ers Message Bry - 4 eue g © Picraxe Boxt Chow" File Content Cant be Wewed"); “Tmage = Tmage: from fite CustBor2 . SelectedTiem . Teshin guy), Abi Plename Text = path. Gad FleNamewuhout Extention ( listBox a Se ced Trem "Te String (9); ¢ 3 Cu AW Crease pelden Pulte Chick code. C SHC Directory. xscte (Combo Bort. SueetedTiem “TeSting C+ exe Box1. Text) c Cc £ 7 ~ MetsageBox- Show (" folder exists"); c - ry ~ else c s . e Dirtdory - Crease Directory (‘ LombeBo xt. Serected Tem. Testing (0° 4 c FA Box |, tevt); oO MessageBox + thew ( "folder ‘Cetated on! "4 Die chery + Gerora- OF -HerTime C CowteGort « Selected Tem . ToSting () + Texteoxltex5) c Get Divsbist Cy TERE Bow 1 Tent HW Covsext Memu Rebresh Cue code = qerDivs List) 5 4 Comsexs neni Reb dete cue O° DiatogPewte ge Message » “ aceereeenel Are (pou sue, Wank delete folder" " Detee, MessageBox Buttons _ yesNo 3 Massage Box Tan . Oust on) = JB (dees e Dialog Peawr yes) 5 £ . 5 eee (uistax . Seeced Diem Testing 099; 5 ele 5 ; 5 qerDirslistey; 2 . 2) non stance membent sms Fe Drive Tajo: The drive imfo dass cose? " ao hai povide acces to ivgommotton owa dive’, whidh pews c ) Available free space : 5) Name 2 “Drive format Divetype 5 Ts Ready vi) Teal Freespace 7 VIO Volume tabel sete. Ex > = [ee -La]x} 5 Suet A Drive V = Dalen a windows form t.0 00 D Gourte vode: ” Y Vieng Hhe mamasface MEd System . TO; i) form Load event code: “Bring l] delve Directory . Getta geasDrva O 5 ter (ime (20; ig drive -Length 5 (44) t Combobox d. Ttems . Add ( deive Cit); 3) Ww Combe- Box _ Selected Indexchanqed . DENT MGS. we Drivetngo (ComboBox t .So eckedTtem -Teshig ys MessageBox .fhow (“DriveName . “4d Name $°\n" + Avatabre spaces + aA. ArlableFretpace 4° byta™ yw" 4’ Labs Name? + A. Volume Label); da to we Files The file choss provider ser of. propextes amd were wamipulas files like creasing © file, wopying » dang, opening tle ete AMombus of file Clase < DY Crtate cy » OPemty D Deletery y Exists > Reppeades ApperdAdt text) Stream writes: Tk (wptementt the text voter Class “that povida Ser ok propeches amd methods 40 write (afer Wrasic” ow two a Hie.

You might also like