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

JPR Lec 5

Uploaded by

Esha Chavan
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)
34 views14 pages

JPR Lec 5

Uploaded by

Esha Chavan
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/ 14
Reg EAoh) Hhalogieal Operators) in Java, CMY (6-3) Fxplain any two logical operators | '1 wollMexample. Cam) Cpw-!9) ~\ State any four relahonal operotors F thelr use C2M) (wi -m) a Of List relational Operators. io. Jawa Ft) nnn CBee, ~ “sed Operators f Expressions 1~ re I *Q)) ©, Operators in. Java. = 5 \ ‘ a [> Operator in Java is a symbot that js ~~] used: to + perform operatans. i Sita) || Qty tneey ooo of Be ou} | Q ‘ Mt i i _|@ Types af Qperatons'~ sa _| ee eae £ aie (2? The! Java’ unary operators peguire’ only -|_One operand. J = Unary operators are used to perform oT Various_operations {e— 0) «3 —___| © incrementing / decrement ing oa Nalue by one ®_pegating an expression? aS ©) _ inverting the value ‘of ‘a bodlean. —_ Or fe Seba ss £4 do iia lot! X= 1O\-$0lay oat Hoga 26) §eido Jo C1)? Tish asian ee a f if or inerernents Hr i a lens 4110 =» decrement fis! 9 ASH, Ay _FWO logical operators ¢ Hed bikvise (omy Operators. | Arithmetic. eae are:_used “paren _||_mathe matical operations. like ad } Substraction »_roultiplicattan_y eens |_and__ modulo (ie. remain e (Ke Pee = ce | public class a ee = 2 aS Static. void plagsteleg aiget om or a °’y | yerurrs 2 AE ¢ 3 Sava Supports six different relaHonal a 1 operators as ae = uF Neel Tb ' “Explination | L “if Example Result als ha aa Parle ainins 46.21 This raat pot i} Operator + used for cheek: | JSgmi/o.| ire Pequality ca f PS listabcle qual [This perdion tur, tn i eee used for we po lorsio false. ee en ; Hass Logical pst hs \ : i _f>-Logical_ operstors.,are used to form ».coampound. conditions by cambining | Arwo. OF pake relations: ' \> Logical aperatons,,..compare or...evaluate \ lagi¢al and telational,. deeisieas i ____expressions- ythue : > There are only three logical operators which are-. related: .vailh — the. Jog ical decisions {ooh olin —Exp pie’ Hoalean. nrbhles A. holdaa: ea ee NoT | true then Logica) ‘er __._Operaior) operator will . make | False. : >7Tt is Unary 0 - a 7 “Types. of Bitwise Operotars’~ O. Bituise AND (#2... \ 1 Te leg binary operator denoted by pi thee shibale $s ye on i> “Hisioalaaivaint if and. only if. both bits are i else telus O, >. 2 Sto ‘ \ a wie XEN ee oy Sei oh TL oot iiteos = ce pop Ce sey 4 ee SS eee a one uh operatbrclenoled by + | Wy {o Bitwive | DEOR. Operator ao HPT AT difterent astra cz I 2 pane ig..a binary opetaton denoted by : I mbol A. oe CRA’ 0.8 both bils are i tbe patty alettl .returng 41- M Example = Lo a oe A es Bis orEcapt a Tate GaN a as ok fog we { ‘int zens] is NE ES or ee [ /) bikwise XoR. a ed J i 1201" In00 = 00a =) ; oe + O@Bitwise Complement Operator — C™~) ie at is a umary operator denoted ‘by symbol Ir it ee the inverse “dr Complement On ee nme coy Wa tog avery 1 oO: | es eainaamaae > Shift operator: used _ jn shift the bo pits Berg po ing oa : Two pes of Ce eee EE \ |® Signed Right Shit k Operator (>>) (Be shifts biti. pottern..to. the: tight Walks PO 296. o wlhib a O>Anm he a, = | a 2 | ' . = ’ { Representation of 20. in binary = 0001000. l ‘AS>3 = 2, = 00000010, i i be tice Operators.i~ (Ternary. Operator — oo, a This operator consists, of. three. Operon and is used +o evaluate Boolean exp. HOO ee Rk -|_yanable_x= (condition)? value (f4true !_ = checking shows ( Nolue if fale positive or _ Degative _ class PosNeg £ aS Ink Nh a een = Int 12Cq 40) 9 oO 7a ifC ize) octal Se Sop ("Nov 15 positives else : = [sepia gt 3 op CNe is regaled Oe ee oe ee Et, “Instance of Operator = {5 sisedii. to test The! instanceof operator Instance oF whether Othe object is _ap- | the. --Specifled Fy pe, ects __ instanceof operator js_also knowh . type. conversion _ operator pecause |_i+ compares _ the instance with ty pe- |> T+ returns either true or— false. 2 Tf, “we apply. “the “instanceof operator ae with any Narlable that have null value— | then _) Rae Palseee ot Operator i= ahs: Se a | RPE Attest. lass mares oe ae ; Associativity is the jeff-to-right or | tight to- left otder For. Grouping | Operands __-to_ operators - that 2m ~- the _same__precedence—- = ; | Ae oS bh ben eee eee Sh wy ey Be CH Mathematical.Functo ns:!s-—— 2 On se a | ee ku , ee Functan..gives— “emailer of - j eae. two. arguments ~——-»~ apa pt the Syntoxi— pai gata type__min (dototype rg datatype arg 8 Gouble_min (double angi, double_argo) 5 0+ p.( Math: min Baa aa) gives the | maxi puny tefé Herd) arguments - gz anguiments can be int, float »]6ng", double. | Syntax ea Be ges ae ‘ datelype max datatype arg, datelype args @e ink tox (int arg, int deg 2 oi 3 the value ef the Firs. argument A eecis Chess diate Mino age 4 expC) o> mek rithms. II I * Syntax .- are exp (¢ ae v, ~ returns ibe base. of dhe. natural loga | } “ft round. G2. 64 he relurns. 7 closest long oy in as ne by the methods _relurn. }ype. ee is 1d ca ‘round ( float +), nie Ih. a pirat f Geuikia d) gives the absolule value of the OL Ee ee D Can, N 904, 5, Jor able» short. te “i Ol |. _ G0, Pe hab) Me Poe . oo ‘ai ee rte

You might also like