0% found this document useful (0 votes)
6 views14 pages

Java Assignment 1

The document outlines the features of Java in object-oriented programming, highlighting its simplicity, platform independence, security, and high performance. It discusses various data types, variable scopes, constructors, and methods, including the concepts of inheritance and access modifiers. Additionally, it covers type conversion, exception handling, and the use of control statements in Java programming.
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)
6 views14 pages

Java Assignment 1

The document outlines the features of Java in object-oriented programming, highlighting its simplicity, platform independence, security, and high performance. It discusses various data types, variable scopes, constructors, and methods, including the concepts of inheritance and access modifiers. Additionally, it covers type conversion, exception handling, and the use of control statements in Java programming.
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
heey Java Ausignmante * - @ Outline. the features of TAVA in Object Oriented Prcjran As Featuven of TAVA- bing 7 Sienple : x Tava Weary 4o leavn ond we. * Syntox ta ean ond’, 10.0 1 oW { | “Woe Contig acs ‘Type Coxtivg am manu longer dato tape nko ete ina f » Nhe called nanvowlra, ConvetMon . 8 May aue Anta lord 29: clouble x =10.78 ; int ye Cfat)x > pecieceact Sytena. out -pwiriten (y) - @ Explain | with an ep example what Pr Paton P Pc wadod dlinpatch . 1g dyna Ap nawic Method Dipakch ue Q@mechaniam in slang where a call to an oreniaee wedhod 1 nerghed at auntimg . Pk ocewnA when ; 5 4, 8 » A port clan suference sufesd to a obi clu oboect - * oo owr¥iddon'» wmedhod that belorg 4 to. thy thild day Sa executed . : ; ye Decision fa wool at puntime dhs ay why ma cated — surntive Palyruonphitm . fg: clam Animal $ , void round 0) 8 BoP Ci Aninal mwah & Aound”) : 5 : ; j y ' COM Dog oxtendy’fninol & Void sound () $ Sop (" Dog loanka") ; 3 5: clan Cot extends Aimat 2 Void dowd ¢) So? (“Cat nuowa 9 5 g J public claw Demo Public. xtatte wid wain’ ( Stringc Jog) § fnimal a: : a sinew Dog 05> »[Link]() 5 2 Qa = new CatC) > i Q. AoundC) | > nisl : 3 | @ What aw de dijemnt typ oh ondnectry | widh Exam ples- : | Ae cthe' wale” Hee’ types of cewebsuietay > ®) Default Conabruct? >t conatructor dhat bo wo parameter i called a Deoult conAtauctor . * Automatically, poavidder by Tava | i no con itny -ctos th written se Gnttiolteos objor ta widh ofautt voduer Geern"~S-.”—~—teti—™e ld SE lan Sludort & : fo eG ene id; Maing name > Atudet 0) § fd =i; name = “Unknown "” g 1 ; - void apy (Ie . SpP (id 4” "+ ran) » 5 5 public clau Demo § public Atatic void matn (String CJog a) Atudut S$. = new Stuoknt CD," [Link] cy ; 5. ays C) Porawetertred Conatouctor: Ah constructor that accepts ont Ot) more Parearactea, w called parameter zed Conatwuctor . » — Intialf ze abject widh wrer -depined* vateg fx. clay Student f int id; String naw 5 Studant Cnt 1, 8sing a) 4 ihed Maw =n 5 void Obipla y ¢9 $ Sop (id +" “+ name) ; 5 public claw Deno £ : 4 public Atabre void man (Strivg C) args) s Sludnt $4 = how Student (iat, “NKe") . Studort 58 = yew Studuct ‘Cros. Raho’). [Link] C25, 3a display; 3 a 3 ¥ . Gi) Copy Conmsbacac tos > Tova, dow not havo O built-in Copy onclructor be x GF. ¥ Bat we can cate cur pwn to copy MH valuey » al) owe object into anole a se : a + Demonte “ova with quitahle eravapln jor each a aa Statement ane wed - fy -foasnfe x cortuvol [vom gue. port of dhe program . fo “Three jump Atateno ‘ | ake ee working of jump daderrets in | | v. boeak a- Continue 3 - pot i) heeak a Bit from 0 loop. + Ternunae A awitch cove - ‘ + Booak out f nated loops wing labela . be: Breall m @ Loep . public clara BouakDomo J publte atalic void matn CBeatrg (Jang) £ for Cf f= ts Pex 5 st44) S : th (tes 3) baeak ; Sop Cis ‘ 3 4 3 (3) Continue Atotemout e Uipa dhe cont rtevokion vf do op - + Gon to dhe wert tevabion , « vad to Akip ape cipi'c volu eA . fx. public claaa Continue Demo £ i publi’ Atakic vord marin (String Clana f- yor Cnt ret; Fests ae yerey Continwe 5. Sor Ci; Boe hon 3 Gi) reluan Statemect. + $a} {ror Q yedhod . ¥ Retuan a value ‘ * ivnonelt ately ond wedhool executian .> pull’ clan RturnDeno f : stale void lala) } SOP C" Before tu turn?) * seturh » 8 ple Atatic, vod wate Cleingl Jang s dinplauy On COP C° Method ended J - g aia Po : @ Compare te dajorence ola oquallicy ancl aeporalecy wish Sromuple{ , : A. Equala 0 + Jo chuck. whathor wo abject ane equ iS * Tue 2 |) we object ane equal jjadre > if objects ane pot equal, nd ba Bering clam * ty: pulic dlow Eales Pwo § ule alate wid €Steving, Cong) § Stvlvg, 84: “Apple ele eae, cropane Aut) Wahoo To compare two objecta Sortig Comppant vay “alergy publ. claw Con aneTo Dew £ public @aww static void main (fr ° CT ag J Shing 34 = “Aeple Staivg $Q2 " Bonnarg"» $0 PCSI. compare te Pol5 ). Soe (8 Compan Ps sa)? @. What ane acces Apedifiens. tn Java. « Explai'y, yow day Ajlect taheritonce . & Accor Apectf far, defi how aceemihe a clay wutod 3) varable in java . ° Java prwyide four eu ys public >. puted a oltfault w- ppaivak ~ i public x Aeceaaible from anywhere in dhe pmogram, ¥ Nu Malriclion on Qccead . \o

You might also like