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

Java 2

The document discusses programming concepts including loops (for, while, do-while) and classes/objects in Java. It explains the purpose of loops for repetitive tasks and the structure of classes as blueprints for creating objects with attributes and methods. Additionally, it covers constructors, including default and parameterized constructors, for initializing object members.

Uploaded by

stake939282
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
17 views

Java 2

The document discusses programming concepts including loops (for, while, do-while) and classes/objects in Java. It explains the purpose of loops for repetitive tasks and the structure of classes as blueprints for creating objects with attributes and methods. Additionally, it covers constructors, including default and parameterized constructors, for initializing object members.

Uploaded by

stake939282
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 6
Srotich — shalement xin efPecient ablenctive ty using Wipe idee maullip iF- Sjedemenks Sytbu Suortdh (expression) { Coss value ls Ycode pack * cose value 27 u code pacate, ss nove COBES dlefaalt + £ code: ay Abacok's 4hj, keysovd ts very evutiol yoitbin each | cose blocks , i eA Pevnineles the — execution of esQi teh ciodement otter rmbdsing. code Heck hos been, executed ebulty crates When none He cileve blocks erecstes | Loop: is & Sequence of Muctions thet drepecds Over © over until oo Specific condstion is met: PUsed to do Drepeditive take For loop’ Oeea Wher we knod The number of THevations, Syntax! fev Gut feo 5 T4105 4+) { Septem. Oud. prin hn(Z) 4 j= county vevable. Vas > imevimed operecer: or -cach Loop Hevodes throug ech clement in he Cuvay Oy Collection , assigning — the cuvvent element to the variable Yok you specif. fov Colodotype vaviatle * collection) f UW code. UOhile loop tae. we ke dow ere re enact number ef iterob Tons _ SF ceils te cake aa top on er dyue. Ex Wt T2090 while (74105 £ System od. pridla(s); ease : : Qo-while Loop Singles fo while (cop bet gue exeutes the Woop at lew once befoe Me condition & checked. Exr ink 120, S do f : syplem. oud ptittley Gy, Tet 3 5 while Cecio) + Jumping, Stalemerts lonenk Used to bear loop entirely Conlinue ‘ used 45 skip Ye cuvred tevalton. Ce Classes t Objects: [ 4 5" A class i Za isa Blueprint / Jemplede for ceooleg objects: ade defi nes the Attyibules + Beleviou€ thal objets of tod chss with have AAtyibutes , + [ prpertes] Aa members / Fields/s4 ti ‘ yuctuye + Behoviour [methods Objects : Objects: An instance & class. +74 allows conlains specific properties * Pollows metrod, Pot O° defned by the chase keyeoorl, dt dyromically glleades memory « refums a reference fhe variable. class abies 1 joe ore alloccteol x Hence O A yramically, i menory oA yuntime ® Dynomically al towaling Conslyuctor: a dn JAVA. comsiuctor isc gpectal method — usel Used be intlialigee cade membevs. oy ae. a S\N hes same name as class. & SL dosnt metuvn any value, not even ‘void. clues ts being crverteal | AS ys caalled coher an abject ob Defaull Constracky} Ay iS cOnnructor hod does not rocke ony ouguments KAP m we Aidkt explicitly define a constructor Jorn provides a default constructor. Ff called qubmabrally hor an abject of chase 8 Crete, Snthobzes dole membesx to theiy ole fault ve lues Pos ameter zedk conshructors, , ont A consivuctr thak takes one Of MOVE SuMENS. —* This allows you to inthia bye objects Aakemembers with specific values. | |

You might also like