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

java Assignment

The document discusses various programming concepts, including vectors, constructors, and garbage collection in Java. It explains the characteristics of vectors, types of constructors, and methods for handling memory management. Additionally, it covers syntax examples for string manipulation and error handling in Java programming.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
4 views

java Assignment

The document discusses various programming concepts, including vectors, constructors, and garbage collection in Java. It explains the characteristics of vectors, types of constructors, and methods for handling memory management. Additionally, it covers syntax examples for string manipulation and error handling in Java programming.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
No. 2 Assignment An_onmay igo _Stractene thoh 1) Vector is Collection __ palde -rnultiple values of | _0f Somedato | frp pe | 9) Vecton ig heterageneous — | 3) vector are Store mon |_4 ____|_ prinnibue type data element: 4) “Tt ia the Shatic memory | 4) “Be _ig_the dynamic ae a\\nca tion: |_memory allocation: ee Atclavation of arey: 5) Declambion ef Vector int _orr(]: new int Cis] ecto ligt + Mew Vector (3) 3 pee whet ig Comshuttar 2 List types _of _Conshattan Conshuctat__m ome must _be_Same _aS_ its clo | nome Ore fated __cons butter L 2 [| conetnicher = riame ( Cargumene}) -————typea__of Conductor _¢- ——.1»_Default Conghucto r : —__lo> Parameterized Conshuttor ba = a3 —feaid SY | shem-outprinttn ("Rell na =" + Sail ne)i GyPtem-outspeintstn C= mamest-name)——— a —- Studeny g > Mew Student Cou." Ane’) 7 y E char Abt) > This exacts 0. Single Charette 4) siaye use of finatiae ©) -rrethad E oo 29 Le) finatize rettad is uted for fam objet ie Syntax - : | holding Some non java. atsources Gucn as a fle & chard (int index | handle then youu to rake Gur these resource | Example Lore freed before an object ic deshoyd | String $+ "ABC'S ~ £ i char ch> $+ charAt (4) 3 q Syntar- i prodected void. finalize.) 14) replace’) Th i8 used te oeplace all the eccurene > te { of & character ccith_anather charac of te | Finalization Code } String ——— = | peel ie —___— | Syntax spies | Set ee i oH String ceplote(ehar orginal, char _aeplarement)t —j____ | ——— E Example E ———__|___8) Hows Garbage —_Cattection _is_done in jova tehich snethods E- Shing $=" ABC”. >eplae (A. p’) ae tod fe it sae red 2 ap a a Lo wthen te ajc —is__not_needed any ment the space - | a a ntpied ny Sut objere tombe conected & used —o- define _ovray. list ils types i Fox later _meallacation Baan Array it __Coltection of same data type. _ 2) java__perforns _reléas¢ of memory a piel_by anus oo —_— an st — ~ (cies outematirally iS _Glled garbage jection. ji types 7 4) Anle__can +. 4+ _gotdict shen this Hod cai ——-}4)6ne__dimentional ar ma }—_|_be executed, aint Shes ma —/8) Tete diementional omy 93 will__get executed eghen the garbage —clitetor Fe re 7 tehich—dun$__on_ii$__Quon_pitks up the object _ pe —4-—8)..0._garbage __cattector Con be__involked explicitly a by —worifirng this _Ghaleme Bp Ne ae in oh At et oie | Systeme gets ph ea epee 1 ingect Element A - gi “Te adds _* element’ to _-te_Vecto: tthe local Kpee eck. —by Soden ma aicntnphe rf le f i Be eceere i P+ acroves_ the clement _O4 the _gpecifjed_by- dt idee? te = ~— dalam, Futeption (Shing Sh) top ht ein MH e665 —— ——— a —— ee atca foe - + 3 ~ 0 ~ : : -—-— fare eon LAL Tige £as).1) = + Sysiemout +1n(" Enter loa of _cimplayee =) 5 pi Roeder a tate age pase Chm atadtine Sa pn yee afler_insertorl-+ : = A tere ty; ECS 0) |_for (int i-03 inv cir): perabion*) 3 —— a fee ges a coe a Sane =e Porna—ntwe Negative Salany Exception ("Enter salary amount ———— a 3 eee) Se eee gt icgatine Sclanp ception ooo ee tsps ae Se

You might also like