You are on page 1of 12

Envoll mpt -2049028

Clam- MCA 2h Sem


Pay 1 - 1
Koll no - 2128I739 cele- McA S47
apeh
cintt Jevca
Suby Sygl (oge and ad Papen Mume SecOnd
Data 21o|2o2

Supa
The Supe kuywand in a v a
ua T R A n
varuabl vaxiabl
hch s usal "to ree mmadiali pcuo Clay olyet
whnewen yeu CTaal the instante oSubdan an
an
Inatance o peant cla kal Impluty whi
w hdh
u resol bb Supen kayuad Yabuntu vua
Us age of Javen Supen kewend
1.
1. Supen Con he uLod to xohs immiciat pahunt Cluu
hs tanA Veualu

2 Super can o url to invoke imudi a patant


Ctay
muthod
Sup) Con ha uAAd oinvoko m
madial pa
Cla Lonssuctox

Xample

clau Ana mal


Ari mal C)

Sslem.Gut pid'n anm y CLa").

Arumad
c l s Dogxends

SupeC)
Sakm 6ut P*indln[" dg ty CaRotad")

Pageo1|12
C -

Mch Sem nol. - U 2 0 9 028

apo MCA S4-

Sobect-Java Dob 22 | 1|
Clas TeatSupen3
pabtit slaic void mun (Stri g st3)
(Dog d hw Deg0,

upur
ani mal u LYRalhd
do a CYealad

LCb)Ars
bunchoyn Oveiloccling
Funthien Oveloadsng n Java occus whan Hty th
funchen havi tha ama bu cav offasn humha.
CUe e to it, whidh Cah be die
upaa mateu paused
in the datu ke int float deuble and u d to
-6etwn the diffeunt valuls au Computad (ns ide
Ovl oadad mathod
tha rupecHve

VSES
wsRd to redu ComplaxiH CAh
Funchen Oveladong
tha eteney of progrorm
nCYeak
volvi n mor funchon tha C
Can ba URd dishngui Sgegabd Cad
th amo each
othu utn
sei pect fo thur Indu vidual kunchdnaly
Ovvloado funciona ng 7Rlar4 , n ovlo aded

Syn lex

ubi cla SHudant


puLir void auddlintii,int j ) <
publc oid add (int i ) 4 . J
Page o2|12
Roll no- 21201 0pECodo MCASu
Daa 22
EmollU20/9o2d
ExompRo
mpov java.0. ,
Public Claw Tut
publ S tahe vord maun ( SMra L] a

Syskm. cut. pint In C'Maun hundton Callhd


Test main (" Evey ona"),

pub Sfuti Vord man (Shmng an!)

Systm.eut pintln ("Hi,"+ anL )


Teut main ("Hlle bvayevd Bunos dia

Pu Suic Void moun ( Sm alSm 4 )

SyAim. eut pointn[" My tbh,


" t ani +", 1
+

Output Ma funtia Culld


Hi, evtuyGne
My AL HloVyenL Buendc dicy

Page13| 12
l a - MCnt atn,
Rol lo. 21281729 ol Uo4028
Pap-MA S{7
Subyrct Jav Dalo 22 l21 o

a ) E xuptiom clus
hiexnd
e cla at the top at tho
Inhthe
t exlephon CloM hrebl
olhich di vett Subcla
tha Thrawablo clas
u a

othe obsect c lau


Throwabl has two diveeclam
xaphon
2

ober

Thsouabl

6xephens

Chek Exuho

Vistugl Momory
ErroY

Onchecka4
excepHon Ass eh'on
Error

Pageot 12
Clay -

MC4 2hd Se
Rsl- 21 28173q Pap Co do - MCAS

Subc JaNa Daa 22 p|2

Meth whon EY TOK bc LOa

Muthd Cal
hondlen

Mthod wrhou Exephan


Fo and hadlen
Exepi(ompute Divis ich )4

Mathed with Excphion hond Matho cal


maon C)

Catcho the Erat


thyow i Cantwn block o oko

Examal
Clam Th rou'sEX etp {
puauc slehe void maun
(Sri a C])k
String st null
Sylem c paitn( Sh ongthyC)) ;

Pag-s|2
La AC2 nd S&yn ol) U20490Z!
Ioll1o12è1t3 ppo McA S1
Dal-22 2
) u s De(ind Ex«ptie
Clas Mytxpltn exlends Exuplion

Shirgsht
y Exception( Shirg sh2 ){
sh Sh2,
pullic Shiry loStng0{
etun ("My ExLophion Occuoed"+s tru)

Cta Example
pulaie s fahc yoid moin ( Sing adsLI)

Ery
Hro n Mtx eptH on Thus u My exso Mu),
Catch My ExuptHen exp)k
Susl eut: pointln{" Cotch Bleck
S pkn Cubint In(exp)

utpr
Stting y block
Catch Block
Ex epho Occwl m u My eyyoy hs2.
M

Poge 06 |12
Ca MC 2d Sem Ensoll-U20102g
Rol1-2128n34 Papo-MCA SU-
Subrd-Sava Dal 22 )in)b)
Genesit excepHon
Clas Exampla t A
Publie staic Void maun (Shn asLI)
n numL , hum

um i 0 ;

num 2 62/num L
Syatin Gt. pritln (num2);
Syteny ut.prinln ( Hy l'a at tho end 4 ty bos"
),
Cadh (Avithmabic Extephon e) {
Syptem. ct psindn ("You shendkd nt diidag by oo)

CctchExaphon e

Sstun cut.point'n " m cut fH-ocL block in iv*)

Butpu
numben by 2eho
Yeu should hot du n
a

m eu try-Catch block i ava

Pag-o|/2
Cla MCA 2rd Can Enoli- U204 02S
KolnG 212&I7 3q pap MCA S 49
Stbcct Jayc Dat 2 2 ( / 2

Selecti on Sost

sPr0qxum
pubbe
class Selcten Soyt Evanple
void kAn S t(1nt aha
Selo.Hm
pubic e i c
fov int i = o, i a d .length - i+t)

deY ,
in = i41, JK arv. lanath, i4+
fo
if cwC I< co Lidax 3)
tndx

Int malloy Numke onindun;


a Cnde J ah C
Pae',o8|12-
Cwh 3 Small, /Vu mbo
Endall-U20 O20
Ko l 28173 Papt mcACU
Subyeet Jy Dale 22 |1ol102
pablie Sl«ti¢ void main ( Shivg a C))<
intC1 von t S, ),12, - , 16,2, I2, /

Syskin. o u . pvintln (" Bedore Selachin Seat")*


fey int an1)
pYint (i+" *),
Sysein of
yain su ptn

sebcian (oot (aoh!))


Syptem ont piln (" Salecha
Sat),
e Cinti:arn t) {
System. a pyit i+ *)'

Cut po
1Beore Selechion Sort

S,12
12-S,l6, 2,12, ly
Afton Selectta Sort

Page o9fi2
mo- b20 uq028
pope-MCA S47
Sogee Javc Dal 2-102

They ceu seveal a UOvdage Jagqed aseay


makes t u n eay whono thon ua nAed to
Slo data n nuultid mg ni ena way wng
wC h
Samo veuual
. hlbs nmem0y onage mlh

Psoqyo
pubuc clas Main

Duhlic stahe vord maun


(Stnrg C] cha)
ICum CICJ nw
IntL2LI,
ah Co3 hw in+ 43,
as C hu inE]

Fa Cinti: 0, 1 awm lenath, it+ )

f r (ind 0 4aLbth +)

mnn pnIhegmgAt
teCrinti-0, 1Co9tn torg, ) Ja9ed coto ).

Syp en .Out pi (a[i ic]+


")Y.
systonOut pnitln 0,
Page.1o
"he jav
hetsCaje

JavaSeipt
Jo 1

Ka f i e u p u t a t n_Ja- nd jayate

Java C etarrma
LA n CP

ava a 1ppsr
machi
A.

d k
avo Code

Cod:

vo p
Closs MCA 2 Sem Ensollmaent - U2643028
Rol1 21281+ 39 ppen Coda MCA S4
Stbeet-Java Dat 22 1o |2)

(b) DoM Document Objec Model)


The DoM ConnectS lypagL to sCYipks r PPYog>an mie
long ug* S 0nir tho3fttuy c a documa
Such a HTML Ypseem a web pogt In

s Laly treUw to Java Cnpt QvOn hstugh'


mymos
msmo
Mod H TML, SVG X ML clo Cument Cu okec au
noF pa t h o Cor JavoSipt LAg ar
Yepoen a dGCumaf witho Uoq kree
bronch ho *Ya ehds in a nodo
Each
Each hodo con taun bect
DoM mathed llew p o g a m mat-tc cce ha

.
css stands er Caxcadung9 ShHL sheuts
CSS descsi ble how HTML RlOmors aL +o ba dispRas
to bi
displapd oh SCYn
CSS Sava o o w k
an cesRd in css
E x lennal Sylu hso
CSS Syn lax

Declanat ton
Seleclov
blue fontSi2A 12 px
hI Color
P7op Value Propatr Vaulua

Inuna CSS
Intoo oEmbaddod Cc
.Exlennal CS
Page 1212

You might also like