0% found this document useful (0 votes)
19 views

PPL Solution

The document discusses various features of Java programming, including security, platform independence, object-oriented principles, and memory management through garbage collection. It explains key concepts such as constructors, final variables, and the importance of portability and distributed programming in Java applications. Additionally, it highlights the benefits of using Java for developing software that can run on multiple operating systems without recompilation.

Uploaded by

jayjadhao33
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
0% found this document useful (0 votes)
19 views

PPL Solution

The document discusses various features of Java programming, including security, platform independence, object-oriented principles, and memory management through garbage collection. It explains key concepts such as constructors, final variables, and the importance of portability and distributed programming in Java applications. Additionally, it highlights the benefits of using Java for developing software that can run on multiple operating systems without recompilation.

Uploaded by

jayjadhao33
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/ 36
Supervisor's Name Pa SuppiNo: Signature & Date __ aa + SE ( compujey_Engqrnooring’) | Psinciples of Psogvam ming Lanquoges ( PPL ‘eases C2019 pattern) (dom = 3%) (910255) —__——| May 209% - paper solubion Time = i houys tai marks - 710 “BU ; Bl Exptain fotiowiing Foatuves of Java tin dotail fe mJ Security _ ) Platform rnoependenk W) Object oriented. Ans: i) cere rey Th Java, we don't have pointers , so we cannoe laccese Oubk of bound aryay: re. tr Shows “AxvaycndexOub- und’ Exception. IF ue iy [odo $0. -Thakls “toby | * Several Bocuriry Flaws ke ~ gtack ‘corruprion or buffey OverFie® are impossible to PAP loiL In-Java:: Also, yavg Programs yun in an environment thal is independent oF the 0S Copevaking syatern) enurronmon|~ @hith make. java PLOGVAMS Move Secure. 1) Platform Cndependent: 1 Complier converts s0c7ce code: to bytecode ¢ then the Jum. CKe cee. +he'| by Fecode generared by the Compiler . This byrecodé can’yun | on any \ plerform bet rndows , Li'nux , OY maces which means IF 100 Compre Q_pregyvam on Windows , thon’ we can yun if ON Linux £ Bice versq . Each opevaring Syokem has 4 srbleorent Tum but the outpub produced by ail the 0S ig fhe Samo. @ scanned with OKEN Scanner Po./Suppl No: Supervisor's Name —————_———__ Date: Signature & Date —__——___———__ pas Roll No. Aer the exccerblon | we call yavq fo. 4 P i) Dbicc orren Led 1 a cs in the berms Ovgan/2ing the peogram iP the | : oe fF object.- OFren,,, Q_collectinn of objecte 19 a way oF L fo Programming, each of which represents ap (nSla nee OF tne Class The Four main Concepts oF Object - orvented programming ave | — + 1 AbsSraction 1 2. Encapsutab'on ‘ 2. Inheritance 4. Polymorphism @-1 8) Ans: wife Ghosk note On: L yi dt he Garbage » colle choy. ues His fan req Grarbage Collector: In _javo , progyommers can't delete tne Objects d. e ov yecollect Hho memory. Jum has q progyam calle: rhage collectoy . Ciavbage collect. YS Can tecolleck the objects tnab are | nob ~eferenced . 90 Jaw makes tne Pe .of a proqyvam- mey eao by handing memory management Howoues, | progyammoeys Shoud be caveful abouk thor coce —+_| tohe ther bhey A¥0 U6INg. Obj ecl® thar have beon used. for a. tong time» Pecay lavbage can nof~ + wecovey fhe _memorn OF .objecta, boing xeferenced.— @ scanned with OKEN Scanner Supervisor's Name Ba BuppiNo Signature & Date —— Date: Roll No. ee ——SS— ") thre: ahd - - _— “Tn java y's’ 19 a. TReYENCe variable tha roferS LO Fhe Cuyreetnt Object, CY can be Sarg » thie" Mn java 1 ——_}48 keyword thar +eFeva fo fhe cuyvyent Object yngtance ._ — It can be used to call current ¢!968_ mornods 2 Fieids , Eo pass an (NOtance of tho cuvrent Clasg ageia povarno ker , and to arffeventiare between He toca} @ rngtana. Lorriabies Using "this" yeferenco can mprove code ¥0ada- bitty and reduce _ naming Con Fics Example: Class Wain 4 tok inetvar_} Marn (tnt _tnstvay) 7 Hy15.. tnstvay = 'nstvay 2 System our. pwnHn ("tig ve =" + this); 4 Public Stance void | main (Shing 019501 arg) Main ob| =newW Main (8) 5 Syotem | 0ub -pyintn (obs. ref =" + obj): t Example Explanarron ! In the Above example, we Created AN object. named obj! of Fhe cles * main! . we then _pri'np the veFevence | }0 the iapject \ tobi! 2 'this' koyword of the fase 1 Heve | we can oe0 thar phe reference of bom 'oby' & 'thig' 16) the BAM. Th Means bis 1G Nothrrn Jour phe i veFerence to the CUTTCOP Obj ec. @ scanned with OKEN Scanner ‘Supervisor's Name ye signaure &080 ee ee aaa F Constsucte, H py pen OF Soren eee f congirutchoy Lanich ave_the E - oe use Ja! Construchor b java onerruct ID ut ‘| ing wopjesta ute One x 1S | vo, rar poructot » MPem- Ottys 1 buts. 10g 1 bbe cons Fn Ate Lime, of Callin ov fox the spec 19 auecared 10. the OST —— Every _trme_an objeh 1% roared. waing: fhe now 2 etn, > a lease one cons Kructoy 13 casted . | Types oF congbrerctor With vexample! three .Hyyees OF comefructor 17) Java There 1 are conch are Usted toejod. 1. DeReph coms Frcechow 1 te Paramerer ized cons FrLichor Hh cop) cong fruckOY It. Default coms Feucher t A cons freectoy Hhat has. no parame Fey. ‘Teele sia ag .defauwl constructoy. A deFcuu- cons ‘ Py chow 19 _'nurerbie + And 1 wo worte ag | cons rsuctd pote no arguments y the \Compiiey dela “not create a deParuj- Conepsuctoy. Cr 1& bakon oud etal tos eee des LR castod a parame} (200 c Uchor. ee deRkuiuk conerrucl-or Changed nto | tne Paromepervizcd con oisuchor . ermepea: conSpructoy _can' | f_enange the _dePalth con fru chor @ scanned with OKEN Scanner Supervisor's Name [Pg./Supp.No: Signature & Date —___— Date: Roll No. a am, 2 Import Java fo. j Class myciass 4 myciags C) 2 | system ouk + PYINENn (" Default Ccongreuct- ow") [ Public ofahe.vord man (String argo) args) 4 mycta eb) = new _Myctass C) oOlp: Defaru- congieructor La) Parameterized constructor : AR _comgrructor that hag payameress 15 known a> paramereyrzed conobsuctor. [TF we want 6 inibvasr2o Freids of me _cla95 with our own values thon Ugo _ a Porramererr20d cong feuciov. _ | Bahra Imporp jaw. jo. # } Class tudonk 1 Shing name } for id} Shudenk ( String Name Jat: tl) 4 —_| L this.name =name j thro vt = Nd} 3 @ scanned with OKEN Scanner ‘Supervisor's Name Signature & Date ] Rell No. TS Class myciass 4 public chahe vor main (Shing £1 args’) Pg./Suppl.No: Date: _41 G Student Stud = now Student (" Axel") say; System -our. printin( " Student Name." + i, Stud. name +! rd." + Studs fd) |. F a1 i eae OUP Ub" Studen} Namo. + Ayiti' Cd 168 a | 4) Copy coma iy ecko Ontr'ico OMmey consis UChOYS copy CONS FFUCKOY Passed Orth another object bhich copies * the data Qvarlable Prem fhe passed Object to He new)! Ny created object. Eyample : on \ ympork Java .'o.* j \ 3 1 Class Shuclent. 3. \ Sreing Name tor td» ‘ Student (SIring hamey rnp td} 4 i ‘ LhiSé . name. = namo + this tot = I'd 3 | arudont (Student obj) ) 9 yea i HIS» Name ie Obf1,:name+ @ scanned with OKEN Scanner Roll No. Supervisor's Name Pa /Suppl.No: Signature & Date esses Date: Hhia 2 id = Objl td 5 Boe 5 . ea Class myctass 4 reid Public orahe ord main (ating argsCI_ 4795) 1 F i System our. prinkin ("First objoct’) + Studonb Study = neo ‘studontee "Asti"; 62) Sy Shem out + pxit " Studo, ame." -4+ Studl- name +" € tqiy * + Studi. tq) % System. our + pyntin (_) \y 7 Studenp Spuda = now Student ( Stadt)» Sysrem'. our. 'prinkin ("Copy ‘cons Kructor *) * Sy shen ‘out. printin (" Student Narre :* + stud ; nome #" € rq 3" + Grado Id) 5 Ub Ub" if First obyioch | Student Nene) Ath. £ rd! 68 Copy congpructey | ‘ Gtugenk Namo + pst’ €' fd . 63 ORs @ scanned with OKEN Scanner ——oceupiee 4 pyres Of momnory For ‘Supervisor's Name ASS Pg./Suppl.No: Signature & Date nae Roll No. G2 O| Explain Following Features of yaw in derail C6 m7 » Postabriity - ny) Aychi'tectuye Neutya} ui) Disteroured 1) porka briyty: Ans} Java_15 desrgned to be portable - code aan be easily tyansferred ¢€ eyecuted on any machine with a yova virtua) machire ( SUM) 108 reutod | | Thig makes it A usefuy Chorce for developing SOF Fware {that needs to Yun on a variery oF arfFervent Comparer & cpevaning systema One of we Koy benokiiea OF Portabriity te that Ne allows adevotopers to Werte code once -& wun sb on HUFiple PlotForms Without the need to yecomprle ip IThié can Save time & effet, and & deploy java applications environ ments te makes 1 asiee to a wide sange oF wy FPrechitectuye Necutarce) 7 Java 1! _arvehiiecture neutsa) because tore, M92 No tmplomentahen: dependent, Fearures fe tyres 15 Fixed Tp. C_progyamming , tnt. data IQ_bye> off pnemow _f fox _exarn- the 2/20 of _pximl'tivo type _oxcup res. OX BD BIE | ach Pectuve xy bppos CF Gemeryh EO eb bit apdbricmns | Howe vee both m2 ¢ sy -bt archi're crugo tn_java_. @ scanned with OKEN Scanner Supervisor's Name Pg /Suppl.No: Signature & Date Date: Roll No. a __| Tava progvammes Sitting on a ‘machine can acoass anot—| __|iSrsrbuted exogramming , whith 12 very helpful hon we m)_Dystibured : Tava 13 diareibuted because 1 encourages UEer> fo ereare diarerbured —applicetbons ee Tn Java, we cain Split a program nto many parte 2 store those parte on different compuros A nev Ptoqv am aunning om ne _othey machine Thre Featuve fh java gives the ‘advantage of | clevetop large Projects. TJhiwa hoip> US to aenreve thr by psoving tho concept of RMI ( Remote Mened Envocahen) € ETP ( Enterprise Java Beans) ai: Java comes wilh an extensive "brary of classes for interacting ,using tcp LP_prorocoia such as HTTP < FTP tohich makes Creahi'ng heb work _connechi'ons, Mueh 2acyeyv tha in cfeth Tk algo enables Mmuthipe programmers cub many _ Hocarrrene, bo morte fpogebner_on _@ Ging le profect. 29 a 5) |tsrte Ghovr nore on Fem | A_final | ") Finalize c) 4 : ns{) frnal + The Final Keyword in Sau 15 Used to reskritt he, user The java _Fiina) _Kkeywore} (AM be used in frAny conkex- Final can bei _f) variable. wd method w)_ctass @ scanned with OKEN Scanner ‘Supervisor's Name Signature & Date Roll No. } 1: Java Pinal varrable: — TE you madko Any variable aS frnas -Sannek change the valde df Fina) vaviable SC Er wry }Comsrant) .- { There 15 4 Final variable speed himi'ty We ore Going to wchange the value of thie variable bur 1p “con [te changed becourse Pinal variable; once 238 gned a UCU can nover be. changed: £1065. Brkeeg 4, f By} Faas Int speed timi-=go 4 Final variate: Vole sun) 4 ¥ —f - j Peed limit 2 Yoo: Public Share verel mon ( string avget7) i Bikeg obs = new IBrkog ¢) + ‘ . Obj. unc» Wa p. O/P Compile epne “evror. [ 4. Jeu fina) mo thod + ZF __you make any methed a5 Fina, you BNNCE ov60y~ too th, |__Exompie: 1010865 Bio '4 st ) Fira Lord run ¢) } BIS hem . Ou «PsN Hn (sunning) @ scanned with OKEN Scanner Roll No. Supervisor's Name [Pg /SuppiNo: Signature & Date Ibe = Clags t4omda extends Biko 7 aes ord yun 0) ie { fees System .ouk: priniin (1 Yenning safely 4 — ; Public Stake word man ( Sting _arget) 4 Hemola honda = nem Hendac) + honda .vunc) 5 —_|-9/P*" compe Lime ewor ) Java fina) Class" 1 TF_you make apy class qa final , you Cannot extend ih - | ott) _homela = new Mondal ¢) Example: Final ciacs Biko” 4 4 class Honda! extends Biko 4 void sunc) 7 System owl. printin (stunning afoly #) 5 ‘a Public arabic _vord Ma!n (‘Ofw'ng aegsca) { honda_.vunt 1, @ scanned with OKEN Scanner a’ Supervisor's Name Signature & Date Po./Suppitio, Roll No. ——————— ae 1) Froay200> method ‘ The A'naif200) Method 18 !Nvoked each Hime_ bofere the object 1B garbage collected ST The. Pinatiz0c) mernod can be usec EO peyFor Cleanup pyrecessing . This _metned 1S defined 1 objeck polees a9 follows * proabected void Finets'20C) is 4 1 alse garbage collector of Jum Collects Only those Objects Hat ave Created by new kayword. 30. IF you have croate Shy Check Wibhout peW, you can _uge Finalizo merned to _| per form cleanup processing thar wa de. bvoying ern aining obyechs, ‘ iene gel) method 15 used jo InLeke bho garbage Collector to _pexForm Cleanup Processing 4 The. _ge0) YS Found tn System & yuntime . classes Public Spane vod gcc) 2 : f. lear Collection 15 \perforrned by a daemon Hyyvead, catted Ciqybage Collector (G1C) + This thread Canis bo, 7 Qumethod. before | Objeck Io gar badge Collected Extimp)e* r } Public clas Test qrbago 2 Publit vord Finalizec) 4 Sysrem. our. Priniin (" Oby 1 garbage coliected ') 5 zi @ scanned with OKEN Scanner Roll No, Supervisor's Name Pg./Suppl.No: Signature & Date = CES Dat ale: Public Staric ore! main ( 6rsing_argsc3 ) a. 2 t Testtiarbage 9) = ew Testuiarbage C) + Testtiarbago $2 = new TesttiarbagoC >’ & = nuts System. acc)" el Sj =n > O/P. Object ib garbage collected Obj. 16 garbog collectoo| Explayn one dirnentrenal & muth'- dimentrona, array used in java tol Suyfable example fF em7 One _dimenbiong) array * Tr 16 Clea From the name pha one- dimentiondal Grray 1 java mugt deal wWi'th only one parameter. Enrin'es OF _Grmray fypes Can be Srored begetney uging one - diméhyen- leoma} gyrays _ Tf can Sroro primitive Gata rypes Croat, Aloap, char orc) . ov Objocrs C¥ear = 4 A Java: Rome _drmontiona) arvoy can be vroudalizod as 4 SINge OW or _q column of oyrod Clemen}> har are yepresontad wy Q vavrabie nare 2 Whose elements Wve | accessed bey tnaew “pares.” Fox _pxample_, tho cove OF a Series of Footbal) marches Can be Sipyed i'n ag CMe - aimenr'tona) ere cosy @ scanned with OKEN Scanner ‘Supervisor's Name Signature & Date Roll No. PSE indox eloment- at Index & felt 2 3 wg 6 Hr 4 © Indies ~ I J; i. K— array jength >10 ————# |Pecdarvatron: ——___] eteneval form dara-type yar -hame CI OR. dara- type lJ var-namo 5 f on ctourcl + type = FJ wrr- Narre 9: tak arvayey ; InbC3 avvay j tak Clarray 5 Example: public class \Example 7 Pub tie arabic yore! main ( Spring -ayg ca) 7 fab avy CJ = 41S) 1orte, 90 For Cit $20) | avr tengm + ster) 7 BYStEM Our. PUN Care Ory} ") i i & ind, ofp, +t 5 Jo 16 20 ‘ Th hove example» we created a.ane armen: brenad array of! Wpe ink and. stored 5 Clemenks 1, B10 +19 190 RK Ser Me ary varinbioc to ¥Yefoy bo Fhe new Array. . Each lemon}. of tne ayray 19: accessed through ft inelex _ucuue * Hse ae @ scanned with OKEN Scanner Supenisor's Name Signature & Date Roll No. Pa /Suppt No: Date: J muitidimepsiong) anay + Murbi'dimensrenc) Arrayd canbe _eorined _ Oy Serd> a5 _awey of _ayeoys DUT in _ Mukrarmenssenal ner Me__oteved om _babitley Porm un rax Gata. tyoo Ct Dimension] [24 Dimengiony CI + Luth sees Oimensien] _ayrey -name, > new dara. tryper sim 17 (Siz: oe rCsi20 n7 5 ttheve cara type | Hype of dala to be Stored wn bho array. 2g. tnt. Char ete. Dimension: The dimension of pho array created £9. ID. 2p ere. 7 SI2Z@N + S120 oF phe | armengr Yes pechively J si Example: import java.io .t > public’ crass myciass f public Starve vord mar'n “(Shing argsC}) 4 : Mn¢£ICJ ary = new inf Cioj L207 3 ayyf{o) [fo] =} Sysrem. out. printin (* avy (0) fo] =" ¢ aty Co] Lay” @ scanned with OKEN Scanner i 7 ee ae e tare oS te pearaad Bama oro Corearor| ieee “hers ST BOIS Jeo) Guy Ul “8S g—39 seul AU Abd ee | —— a a OT Waxed Oey Gua GINO ysswIs eyiode! O Se0ID FY S301) SlixeqUy Sous Pere aR Seo ——y | HTT Tom oTROTTT Tamara & ag F WV Spustxs J Sood edns—souj> TT XSTUR SSOID Oo Jo OTs] ead oe TaqaT eo] pos pOMRB] wet pUFIKT——] o Seq sranT TRIO BOATS TKOTTRS soap TaTaT sr 61s by SSN GEG a een] a] Wasay S60IY poRlagp oH STE IITIP SRSETOUT 1 Y eiqwrnoA POLST TpRe Soul SPST IOUT -FSaIqvIEVT} vw SSbIo PoaaTa PES UHO BIT PEO WoT Sov]I— PoaTaap SUL 3601S SUI oibviS Sebold Wened seuiy sa) ssnvisdns— oo} Casi Sadan ouTbaqiaquT ei GObII PIATLIP SIbTIS 3 sTieyur ow es ridexd sso sour aT ae oF wUEIAUET Jo odky 0 oF PIUOTTIOAYT 16S [bee Canbis pias? Sea poate ) SeeIANT Sw UHI TST TARTUT HOTS pouBli paoaqaT — BAAR Se sareIAIaTI idee | SwaiapaTd F Solow SA STITT SESS POAT Sal DUCATI TOURS dia) 6S ORD WUBI Jo SIH CNOTIDA OAD waUE MW OTO4UT OMG eo soueTaUET—aiGui6)—| TT OCCT Fo ORI onreang hal @ scanned with OKEN Scanner | fru TOPOS kA pomnoTey SOT sq FSU 8K * CUBTROUUT fomyub ia — bg —pocreal oH Una! BSS eT ToqdaKI WT res Ea] [eso] er bra 5 z Tye rot Freag_ Soubt gaat Pm Ww Gamer So GMeU ai quueTAodu! go purl WT aT Weal 7 SevId Ward —BUIES 9H SOY SSVI PITT 7] Tus] TORR oT BERL fe epLOMHSATbormveney UOTE |G Sus TOE] SMUT SpAae AIO Ui AO CCSSSOID IG) 3 Go] Sbad pilD ous Gow WOW GU S60 6 Vaart JuuIpaqaa TTpaoay e AETIGOSTIOX OP) BH Sapa Osa SOS PTFE TER OGTR PED RIPaA STOTT TID r [a eta — bats Boga GOT BAL TET ROAM FO Saat prac] E So WS wore ogaas A a BT IITT PETA TOOT OTTO FT} T SeUalig 3 seers TEMA — sovensoqay orem V opITTe ST pa < WU ee0ls 3NGnd s01> v [osc] al wasreread THICUITAT TROT ABT ORS BOW BH AZ SHS vue [22] STEUIELGT I mite asddis asso Bao d 900i fe oy ‘@ad] PTI rare | ord Gy Aimbeqare— sro | TIT aa TRE — weTrOTOA- Aa TET —araTITT Oy — ‘aTuaBraaYTFeTO—adTIMGT| Baldig sib a visddig srbonbiey 2H0 Tey F Iai wraKsey 44> + IOLA aS ON OS ON HO x) 2700 9 auieubis 18a omy — vomeutig 7 owen s0s1000S, Ee) ons by ‘ue 6 sosmsodng @ scanned with OKEN Scanner TI OK3 Stare trou ogy aq Tee porate xr a i TXBTOFS— 6 7B PaN —etao1 —GTOI— FT BIST Cee eodhiuondax3) 43109 T WI KorCks RF aIs porated a ET SCTE OGIO AIOIT OHO IIIT HIT GeO eq aa 7 Kaa are TH THO po OT Te t FE GAATINS Cat PU OF PAG HOT HAD (a straardars} yates TWIST HOI G J Dew pavorond Ty T Aer I xETTS | KireuTy Dros RaDarerd ea UT ounce, t Dao SIDS — ey JawOT Hah po —SrasaTSTES | Candas wea hour TOW eps: t ee ee ro E at ae waaay aaoaTTo—o7a| sara AT RT go KT NBASSITT CHIT IS Shoo pay —-Jo woe A wwag TIT CHO 0 IO We ty 6 Snares Fa0ig hirer aq f a OTE ATE Tae t (Cyan SUN” Sena VarTaRT ) HOT i 7 5 B301d BIBT 7 anders wen hea BB RF 7 t Cis ama OTT Tray BIT TDI eyo HTS ae] ene ha ‘ON Neu a0 g ammeusis uen $sosusedng a9] onan | @ scanned with OKEN Scanner wos hay owed worm gnads —obosisnd burovanray OT RIO wT ary sESEI MO oad oH —hgTISIS SF SS GTBISSOII= BHT OGTI TOI TOA] I ae] me rrr —orreroonns HIVISSETD OL WEPHTI—I—eosewys —pacabores at — Tased S000) tq perma —aboisoduaet —abaqaed POTIOP 73Sn | prs gare ao OF | Fi He rar aref gore pret ETE OR FOU De woh hires are | bo ay abo —vawr—burisixy ob oFOg ATID t TORT TST ATT oboe or THe abou \aaw\orop Passe oF OF PROT] ‘smepumn 6 Ur oaIES POUT op mF abean ore ort steed Ge pore warsed —o— FUTOT Wray OF} vi porlsoberns ed Opa bal vi oboased WISTSKE JuowToraOP DION abawsed, eT 1 paveuna te UHISE aig ont vi Powstoe ex Ténur fysxonaig eBowoed 0 Be aiarpuRy Wdmet qndur way eossoia > OF onOe—“T assuIy toTUsuOpIg HF calPung ; buoT™ pal 7 [bad bad J bad aoaseg Tap Ror ar abored bungie oat yo SUS may TERGIG Sl abr wascameU FARIS SEDO SuTBT TERS pararars —ebaas6a PO TaRsTGT-JO-WaG PURDUE aa} Sea TOIT FEAR RUMTS COSTAE COUTTS GOTT : rare 30 Ferchosé oe Paryap Hoos obo TeS a shaasoshy—obosed FI TAGOs eorro louver abowvatar ero rrcarva- Em ESET ETE - pores sass 3 epee, IURITSTOTE—borererrey Gecparot] Foran SacI SESE TOTO OT STIG: oF oir aad oF OT G psn AD SobDPUT wb A ToS Oa JO aaraU 8a et — bord ara TSDET coe 1 Eid stowed “psy -erdaraxs ai —sbaas0d te hiseacarg_* ATI STOTT a eats a gTOT OH JOBS TASTES Son WETS TOG aL OT I IEROTT UTS 5 Cua =P oa i aan syones aa ae OWEN SuosANedNS [ew ssangy 6a] ty 8 0sicsocing @ scanned with OKEN Scanner ot) 7 36 ur > . oT 2100 pUvIKS sake —seeTy ——] Tan Bae —spradeaT "bey ed ADMTHKod au wars —Sowsoly oa] 8 soda |S ¥ Gemsarseniy and £ Comer pion Ta quTwros 7 E ¥ PUIG SpTEHI bog cours SOT Spa —sreThay SUIT T FO Tan wap Taader T TEN ST TIO Tah see ao TUT oT fe Oper tes OTTO OH URS ME wST SST Canta Bion wand : 4 T osureras TEUTTY—eebI> SOO TH HUN SPIRIT OTOTKT FOBT Torso] SUT paGTOMT kira Saree sooouaKnb ys} 7 Tord woxt RRSP CTORET WII VAT Seo Saag ISTO | ——~oner ewmxboratay, oO 7 wort Diaoveq bv ouIgop oF —Hin@D dat GI burp IIS Jo —TgOT a ysagtar poop swoibosdhu sroghar \eoeE\ swoiboeThal Vo ar TTT st az] sar quswaewng ScepuI 8 OF ee OF Wyod SAT HueveMoud_eoeewleN VT at maa 13-we- ; “és “woMIGy BHR —o] —eTuaT —barBraAIAE HOT — par ache a(R ~ Fe sa ‘ ae Se TSH een Ly —__—___—— os : ory ea Se oH. Osisdeap Powe ino x we eg} one 19 vanes ol, ea a ie Se Lis @ scanned with OKEN Scanner meee redeigtapuld © 2 PIGS “enon 6 pie f wont TS Keg x = ad Taaxad —sprarn Gate 6 CPI eu qed] tact ° Cuong eas Juan | BUTTE 92 fao seus Kad or —paxays | > waadas%s nel UI peen epaooihay erry ox SoaL asa faa —wo—epusctaps Arter poTATTTS] ——— ig SHOT TOS OL punaTTeNsey GO pns SUG et PTO powaw wines pay —ereTe ACES AT Tan apuEd oA wISTIRGRST Bei GOTPTON OI IIT 7 DIUTRY TE So REhTs gear — PORT —ay z ic PRATT OI ATO GATTI OH FOOT THUG WeROJOX Koya palaa Tp porsa —o— barns o7 OUT OS SOS IIT SA a ped oF SwETTTT AT | eT | tryxewed oH Jo ave oon wi buTipUEy va aooKS Duy tq spovism—pappofiawu aH Sto fuer] Ou OW Jp 4nd Ue So wT a7 20 GarOOTUMUTEAD Jo sipela oH WI Feel vag Soy VeTIeTGe Glo y > oF Wa Sel WITS BH SHTBTS TOUT Puncy oy wUUD povedo of F spear WH sig y= PLT SCTE OO} PETRIE STOTT PORTIT—T-TATOTAT Biop pirrut uo parse eoy ano = TIIDS UO SIH SOTAOUIIS ase oT! carr ara TOTE OT OE BOT PoATOLIT aT POUT VIPPIAITS Ua DID SUKI Tua P fasw Ws inIe Go) TERI. wu Fiousxouqo SHOUT Woxbaxt WHE padasip at wether oA IT Gos poaLET OH WNISS UEYais UO VOGT Waldesd wa Uondssxe Ue ——TaTGAL 4 Uwe o PUM paleo ve @ AT aimrbods HEY Fo Cais feared ou S1dns8" WUT Eada aT Dig Sore uE aanipusy TRUTOUqD UE si ayaa EIT PTOI CUTTERS Cay raze RTRs ETTHTER_VAIIDITA_eoMOT OTT En —___— Re) ee errasusda pores eI ata Soe iter ear eT een Le ge TR OTT T leip pus sare = ‘ON ee ON We so] 75 00 § aineusis ta Painieutig onrsens’ 6 $$ aun sxosinscns ———— ati soso @ scanned with OKEN Scanner Po /Suppl.No: Supervisor's Name Signature & Date Date | Roll No. — |___s[ureoscny of ya yo Exceprron C1493" 00 «tal - = All_exceptron ciqssea ave _sublypeo_OF the J au aes 5 Subelas -———Exception Ctass tho _excepbon caso 'o 4 © S4 Te Hhrowable class. [object i y | Trowebe] ; why | athe | u \ Exception | [exrer I | Teexception | , UryFuasMachino Bey BOLException Asser Hon error H | [Pen mericex cepriog) 4 Null Porn ter xceptran [NumberFovmareycop on £19 ,__Hioverrchy TY pe: cep bion There are monly, tio Fyre OF excopprwn !\ chockod ¢ unchecked tonere ever ys. considered ca tunchecksad - excep rron 1. Checked Exceprion 2. Un checteod _ExcopPtion >. Grror. FF Tava exception Claago @ scanned with OKEN Scanner SupervisorsName Pg /SupplN Signature &Date —— Roll No a a Lihat 12 the concept of Sivcam 5 Explam byle Strom ¢ Chevackey Stream yn detail. % Skream : =| A_Srvoam Can be _deFined a5 a Sequonco of data. ——|There avo b®o kinds OF Sstreama —| |. Inpursthroeam 2. Out-pubSfrroa mM, ' | InputStream * 4Cnputs trea 19 _uded fo vead dara From a Soure - -| Thia Skream i> used For reading data From __pho_ Files ObjecrS can be created using fhe keyword new & there aye several types of constructor: avariab te — ——| Folloverng construc ak File na 06 a Sing to Creake an tnpul- Seam -objech to yeaa Ene rie Tnpw4lreom f= now eile fppul-srvoam ( *c- [fave /helto}, € Followrng constructs bakes a File Object to Creare an inpurSrream object po youd tne File 0) mMethog 9S Folroux File ¢ =mow frie ("¢: { Tova / hoo") ; _Enpu-shoam = new ErlefnpurStream (F) + 9 .Ourpulsrreom’ 1 Tho ourpurstroar 18 udecl__ For wowrting data to a dest ncricn Fie dukpursrroam 1 Used fo creake _q_ fie _€ vibe data into jr. The _Sfyeam __eousel _creake A fue, 1 re doogn} already ’yx15t, before opening tf for duty FolloWing_construde bakes fe namo __a a_stving 2 croale on inpulStreom) _opject jo _wrire bre fio @ scanned with OKEN Scanner — — a 4s 1 a Tae Hs Troma ps ee | oar rer Orr -___| iT wap oz" af pee ; [zt Tench: pre Top F tore Fe pee TS Tar eI Ewe oe a — gents XIO AT Ra Comers : on emo aaa | rama (CI 615 EaASY crm RIOR SHOTS STING Sat We, oS ob ay Seely Tad naar ad { eer rene PORT STOOIT AS ————J——t maa ve? caren ___ a wememaaracs |+— . aT TOT o 7 1 Spear pO Sak SOT SHIA TT F_ OW eT Casto Sars Yama Blame eg PH GSTS RP SPAS Oa PaaS TGA Pes ¥ Fg eee = TaFTSTS TEC OR eel ee ahs OT | rm a ei ara — SoG OPTS — PTOI Te orscop eee Pap woo gTmOorOT apAOOTOVE UG WT oe ory aaah og BR ara0~ Rebar ot ~cacsarr] PER Jo a6 SNOT ano arsirer sea — Goremaro| ed with OKEN Scanner & scann Pg/Suppl.No: Supervisor's Name Signature&Date par ® Roll No, ———_] OW = now Fiewrter ( rourpur EXE ink C; at hue (Cc = in-reod (0) | *~1) 4 j —\ Ow. urri're Co) j bh \ F Firany Pore Cin t = nut) —~; 7 4__tn, ctecoc) + f YE C0ur t =n!) ‘ ! ah 4 Wis : OW Clogec "1 = 4 adh ‘ t : F QS) explain aieferenh ways fo implement Threads In Jae 9 tOr'th coco €xoump te s. 4 e Thread } ‘ -| Thread 1) 1a Nght weronp PLO Coss | A_progvam can be drvided into @ no. of Smay process: | Each process can be _addyosccd a a ingle thy eccf a =|ZE your 01005 19 tnrended Ip be” e¥ecui-ed ao a thread +nen you con achieve this by senplormenting ~ maple rer face . Fou oi) need | _foljem theo basic steps Lt i bios + Impiement a rune) mernod iproorgod by a Punne! es tDberfaco . A % @ scanned with OKEN Scanner ‘Supervisor's Name Signature & Date Roll No. [Pg./Suppl.No: Date: Thio method provides an enby point for _tho knead & YOu | worl pur your Complore buarness togre 1'ng1d0 his motnod , —|_Syntay: of the sunt) method * Public vord yun c} af it |Skep2: — rnatanmrake co Thread _phyeck —uS1ing tho Fallounsng— On orrir clo —— Thyead [Runnable Hhvead Obj » Skiing bh cod Namo’) here, thyeadObj 1% an _ingranre 9 _a_claes bho i ploments the tunnalie _inkevfaco _£__fhveadName if bho __nerme grveg— to_the me® thread or: oe a | Steps. Once _g Throad object [o Creare you —CAN- Sharh y port () meted. hit exooures a Catf— tk_by Citing po Share bo wal) mopmocl -Syokay" void Stave (0 i 4 Exampio : Runnable Class Runnwblofeme _ Implement i Privare Thread _t | Psivale String thveodName Runnab !Cpeme ( Shing namo) i LyreadNamo = Namo ; System .our-pintin (" Creating * + +threadname ) - Pubic vord unc) { @ scanned with OKEN Scanner I iT @ scanned with OKEN Scanner a ae ~ CRBS Bea signe 2 (PCR eT MONROE F Posaua yw Hara Te1F BUN BOREAS, BOOLGL «Tha Signature & Date —_________— ga Supervisor's Name Roll No. 2 See eS System -our-p¥rotin (* Cyeanng " + Prveodname) Pubic vord rune) i j Byskem. Out. Peinkin (*Runming * + threadName’) : rey ft \ for(int su j 70 j i--) et 1 bern ou. printin'("Trroad : "+ HveadNomoed.","+ Thread sleep (so); im } Caren (_Interrupied Exception _‘e) 1_system_oub priotin. (+thread "+ thread Namo ¢ tnrer Je yetem out ptintin (* Theed “+ thread name + extting S pubsre vord Srevec) 2 SyskeM our. Prinkin (“Stating "+ HhreadNemo) TEC es ena) | i ‘ 1 & + Pew Thread ( bhrs ;HhredNome) . bs Sraei-c) 5 hi 4 f Pubic class TestThrea of 4 Pubiie rahe word rain ( Sheng args cz) i Threaddema _T)__=\new Thread bemo( " Thyead - 1") 5 T_istarii() 5 ! ThreadPem® T9 + new Thread Pome (" Throoel -2.") | TH .Shearrc) |} @ scanned with OKEN Scanner ‘Supervisor's Name Signature & Date __ Roll No L455 [Pg./Suppl.No: Date: Explain the below mothods in deta) Fs mJ — Q reatrve, _- wy) Nobry W) gorPrtonity ans: | 1) Toque: The IsAleec) Method oF thread class Fests rf tne thread 6 atruc. A thread 16 Considered auive when tne. StavrC) method of ‘thread class hasbeen called ff the Fhveod 1 not yer dead. tha _mermod veruend rave re ne thread 1m opr yenning & not Finisned public Fira) boolean ppAl'vec) The method will yeruyn frue tf Fro. thread 18 ahve OFher wr xeruyns False . Exomoales public Claes JavotaAlruc€xp exrends Throad 41 pubis vor rane) 4 bey 1 Thread , Sleep (200) 4 = syskemp .ouk-priptln ("18 TaN Method i _alrve’+ thread . cutronttn read ¢). tSAlive cy) + t t é Catch ( EnteryuptedExcepuey te) 0 | f Tpupire otane ord maid (Stung or 4 JovolSAlueExp ty ~ new zavargAliveexp C)) = System out printin (' before giaching lrvead fg Altvo? th: feprivec>) } b. aroe te) j " syorem ub Prlnnn (1aFros Gtaehing Hhreod Arve" +t) } * FoALIve Cc) y+ ; j @ scanned with OKEN Scanner a ir oe ror air 2 “aire TROT 5 bapa so day Oya —sassunubrssu | ce rise—oasbaaus CHIR TET —OF eanTUT TerSeE 7 | remarens odie ® srcraag —bareurg Brae ML FOBT OT © | SERS Ba BS ota PRTC Kraay or Rrra Go| sunanTy SOP TO RSRVEL Jo WAT OY_ VT TU OKT erase POTTS OTOT CUT bea AIX O vi nT poe ee ee Parad oH A apa wT ABSA TOIT OU A PIT BOREAS [ros Ca UaTG STF VOTRTOAF FIAT AT Poor OCIS STITT | —rgog TertaIa Jo 350 04 a ar IATA Saari yo cory | Sonssy hae qwouTO” AT ous BT IAP sag sag —sivatoxd] Greg 01 poTOXE HOT ATER VU AT FUTHTAIAAT TAH fgridwre— er pasn ers cOTDAITIT eHOwIOS-oU]Fo-9UG_-=I AT] - swepx24O1- qa Digs TT-TOATS YIGAL IUOTT ——agassoaey wisabod eins wo Wo sr Glan BEIT PG clan 7 wbowaunpy © eAPIDIS 34) Bie” Paleo Ue ey ba 0 OF OOF pa: Oates qi POR po @ scanned with OKEN Scanner seT= Subd see =| bora paso oaT a we TTR wa rm ATRbOTT ary ONETO Baer repeorcxrzcy Eres sayy | TOD TARTS Pop BORAT TAT rer oy Ra Sos Garsipa a sway z ud oT 3} poour ee a suena ae pooKy Te CTO 7 L150 SHOR Tad SpOITE TROT ® os pou 5 jG SPRATT CHT —CFSRTTE FO MUTT Peaenceae ana ae onons/ Be i | TT | in ee | Ha | | @ scanned with OKEN Scanner | ONO gees ial @ scanned with OKEN Scanner Pheseor saab ar se wae 2 pert teuamips— 161g p preg ww —errombay—saat—— 2 —sarrer—asor eos Sho OH seaman’ —sivafao— oA J ————_———frrasaroxbord — ror} t pas wTT TE ae SEE ARB Pn taee—enog | it eC hes ne paar Boye voror aI TIOT estar EAT PRET TE HR OTH TOS TOT AIT aS a TEHTOT aed ‘on ans/ 6a] canned with OKEN Scanner TTT i with OKEN Scanner -d ‘Supervisor's Name Signature & Date Pg /Suppl.No: Date: . Roll No. Foatures , Al50, Sh _ (0-8 b) | Peserrhe Logra! prograrming . Enlist tS ae s 7 7 ut _ the _cornmomly used Legical. programrning languages Ce} Ans’ | Logica) programming + _ FY pobron Tp cirack mode) oF computcl + | B_cain__ho_ Od as. cbs of mode : Le Series ofc. | rn tog.reel programming bho—pna. I 22pes | cOouwlcl be aolve log. ical probierns Like _puz2l@o_>— knowledge base _eohic by Tn _logica) Programming we hove 4 | u20 Jeno) be Foxe qe tn pre quearion «& knowl doe machine, yp Prod 403 wroselh | base ahieh 18 given to ‘np _ernphagiz0 16 OD | knowledge base —€ tho problern. Te excourion oP the _\Pvo. Gram 14 very much Like proof. o ~matnernarca) Sbakemont_ Prolog Example. i | SuM oF }100 puMber in _Psoleg_+ Predicares Sump hwoNuMber.(_'nfeger , Inbeger) clauses urn (0:0) Sum (nit) im @ nent 7 ure (Mt) \ s-8tN } -| Tho logical paradigm Fakes 9 deciatatse approach bo i ™ SS |_propiem sotuing varibu® 10girel aecertions about g i 2 Armart on are made, Establishing alt knoron Lace | Then queries. are made A ng Brak ge. a8) Darateg dvanregos,: TYP The Sy¢pem saive. the problem, Othe Pregramening ereps prem S01v0s axe kot fo _a_minrmum el Providing Fhe vardiky OF aqfven prog. t8 Simple, @ scanned with OKEN Scanner

You might also like