You are on page 1of 48

clicctte

ioat
O-03-22

bubli'e

void meth 1()

int ag3(J =
Fo0,200, 3o0
= hew
ínt ag4(J itJSU, 12, 13, 14,1sG:

Stg

+ avtt 2: Jength) 4
Jengh
Syso( an3 dergth
Syso ( atst 4 Jeñgth an94 Jergth)
ls
S yso( Sthy length D)

Syso (4 )

Rerevirg he deta foom anslay

d at 0 25 0
pinting
35

qrTL[3] : 35

data at
4th
jnden pegitin
Date
Page

Reheilig the. date om


íz2 911- Jength 1 it+)
fot (t ieo
Sysö

Retseiving he data fom a1 ín rOVle.


I
0tdet
y uyihgfo-lop

out: pint ( a4A (1+


Systen

Sygo (
Retiving the icata fom
eachoop
fos4 (int data )
Pzrint

Sy&5data +t );
Syso ();

Sugo ( as491 3 [ ceN1 Jength aB12- Jength]; ||200


sygo aA3[31D)_//Arayndeo out of Bod
|
poAtkon
we
te Ch inden
uShic hot aunilabe owt
we
Áton Enception
classMate
Date
Poge

Void moin
public. Staic (Sting. CI algs)
ne) Clasg A
(0 methi()

Joutput&

rsae
Coe
Aancad
clssMate
Date
Page

þackage Com
packi.
jawa: ute Anoys
Smpost sconne
Jawa util

public -elass ClassA

Void meth)
Sconnet [Sysiem in);
Scann hew
many tHckets you heed ?

Sbing nane
[J
=
heus Sing ( Sc
-hetrt ()):
Sysa ( yo
heed" +hames Jehgth
+
tiket}:
Syso( Please ehtey ) +nanes. lengtth +"aon

syzo
Cugol
l Dake. potesnt in Anay ==)¥harg
ata Present
in Anay* Ay to

Syso0*
syso
(" Reketiving he deta ay using fo eah
o
sting. data'nome3)

Syo( data t

Syso ();
cassmate
Date
Page

on
L_zeseiving. the lagt One olement
Of tha
He
=2
is
f (name dengh >=2)

(' name [nameslength-2])3

else
Sy8o(==+ nameg (nameg dengthL3);

publk static Voiel main (sting CJ. ats)

hew Class AC) mehi()

Qutput
classmt
Dale
Pane

collecds multile elements of imiay


Coninios Block of
dattye in

dangh 2 3 4

irden 2 4
Length 2
3
4

jhden oi 2 3

Jength 2 3
3oo
= $l00, 2.00, 300 asl3 lod200
d
a3[1
inden 1 2

lit t4[ J= hew int[I $11, 12,13, 14,IS


Jength 2 4
2 3
oGAH
nden 2
4S|
14
3 4

lDelaßoh3.- t8
colects oNy honoguheaus daao

3hete No

final aotiable
jable s wled to
hch
get the Jehgih of
En- asbl Jahgth
cdassmate
Dale
Page

ongth a
C)a- is finalmelhedShich is ual to
qet she Jength of Stings

keypaindk in

oßject
Aheime of Agay
Agay
Dedatatione shauld
Decdatativn not
speeiky he Bizeo
hetsE tdete getting

cenptteine-etBt}y of

wald
a
int Valid•

(iAt the tine of intaniaion. HoD we

need to
to pacif the Ugize othel cwige
otheoigeeoil
e

getig compile

iowe Shoud nat give nsgatie.


hegaiue hunhets
Size ecause it gehshl

e os of ah Arue
(ah foalso Jength
any data înto
into the
the Aoa1
Cant pols data

(viN
we Cah uje int, byde.,
sht chat datatyjas
a Jogth an
classmate
Date
Page

t• Manimurnnsay Jergth. oe,marimumize


datatye

is an ndened
Of numa
colection fied
hontogenaus dat elements

aNHOytoes Multiale data demgof tho


Same Cotinua Bock of
datatye
vicdedrto

humbe L2 |3

iii
poo
The. mmin.
O
go tot
multiple Value. the Same. hame
Xeadabilchy of
of the
he ode.

The. main dizoduantage of Asay is îtkfnd


Aongth.

mean Wecrealed
Ohce thteis sizeho
chance. of
inctpheurenst
încsO ing Jecsealthg he
bsed oh
That jstoule
n
We should Rize aduahce thilh
not posgikle. shnauaygo
classmate
Date
Page

we can rosole those oubkosns, ay using caletion

Hou do dedoole.
-To dedate an
followd
BstackeL1
follouwed
by'the idenifet Name o

C
At he ime of dedotatoh.
ca't speiky the
Size of

Hato to ingtantiae - oingtontiate (ost


ah cobla
(Creake) an
aty
9ik the neo keyostd and the datukype. of Hie!

aHAayfollowed y the Squate toeets


Containing the humß of elemehts gou want

in Jawa is chject Behe


Evoyay ne
classmate
Date
Page

ibct [s1valid

/valice
()t r
So valid 4
intTI 0NLnm Ba!
=
$lo, 20, 30,40,

Psay size -5
=5

indiies 4

the Jongth of

hehden }of ah Staxts th


classmate
Date O3-o9-22
Page

pockaye com:pot

public clagg ClasgA

public toic. vod moin ( thing aogs[3)

fel (îat i=0; i43;itt) /o<3


03

fet (intj= 0; j<3,itt) |/ oc3


print

obditioh fal t
I/Shen Loop Hesirated
1/ inne oop
/* reoth
to oule
agaih Same But

Qutput 2
4 S

inden 2
den 2 3
0,0) (o1) (o,2)
4
T,2)
2.
2,0) (2,1) (2,2)
|Poactice
Pint Paintn Page

packege com pokL;


rgitami-
leublit dass. Clasg8

Void metht()

Syso(Java
Sygo
s ):
aesone )?,
Syo Pbint (
Sygo (love g))?
Syo
Sy3o (Saya is oet ientel )

publk. static void " main(Sting I]


hew Classs -methtU

utpua Joua is Qweome.

Jaua is oBjedt

(pint

(C

(Ie
Dagicat arn classmate
Date

Pockge lom packt


rny fad.
ahie okge
publi'c. clasg Cl0226

/* Giveh
Or,Int CoAaJegth 3, f thote 2
in
is
he Smidiate folloe 3, chohge the ekekt 3ta
hethi()

t 994J= $3,23
fuy (int f=0 i<a9 legth 1it+) Encpto
Jeng
3
if ( aC]-2
3 Li)= =3)

publc stahic Vold main (Sting CJ ogs)


ne
bobj - melhi(

Syint (datat); I|22

C
clAsSMate
Date
Page

Prgelos Com-packt
paskoge

public
tho
of fndegtretwh
elermen
of the
the. a9ts\ ay Jengh is e33
enizts
han 2ar
the elemens that gehn o
a Jangth

So, o?
meh3 (id IcGH)L 40, 60,

2)
if (as Jength=
gehsen
elle if (o. Jorglh = 1)
getwn att [o]
elie
o
etsh

pudic sttic void


(.

hew Glage BC)1


Înput ]= 40,G0, So, Fo

nt egut = bobi rnetb3 (input),


Sygo( Tegut)

(40+6°)
classmAte
Dat
5-09-22
Page

public clagg Cloag


* Given
apjaos ag
oay of ).dewen tue 1f 6
eithe the
clay (he fst 0 ast elemert. n
the
Be. Jangh,
public hooleah
mete
fustlas int [I nums)

)if (humg Co]==6


sekin ne
yetusth false

pubi'k stai vod

int inut []= S6,8,,2ij


boelean
7lt asbj. finstlac(input)
Syso ("5)¥ relut)|huee

tatu
clAssmate
Date
Page

Rrgsar2- public. dase

of s, detwn te if4
Jength o9 aud
element last element ate

Sarme fitLagt(int [] hemg)


kublicoeah
u
F(hm Jength 88 numslo]==hums
gth-1)
rehish false;ue ite ke hia.

oongs
publis statit blcl
bid main (Gting. L]

Clasga aobí = ne ClasgA) ;


&,
int input [J:6, 3,6?
boslegn resut = aobj Sarmeistlcg+ (input)

Ouput
classmate
Date
Page

publie. dagg ClagA

9iveh 2 ouys of jnds, a ang b, retuxn


tue S ame
tis-
. eleh ent at thoy
TaWetho Same, Jost elemet
Both

publi Commonnd (int [ J


,
int]b)
if (alo]==b[o]
09Yetushte
retush fase

public Static

=
clasgA hew CkasgA)i

= 3
boodean reult anbj- ComnohErcl ('nput, inpt2)
classmate
Date
Page

Brda4 com pockt

public. JaggClo3A

of c9lay of ns ergth 3, retn


*ven
Sum of all tho olemenlg
.

eublic it Sum3( t CJ um)


e nums o]t hums[i] t nums2];

enbl'c.
stt
claggp hob' = neo Clogs Al
4
=
int sezut asbj sum3( inpu) t

23
classmate
Date
Page

package.

bablic Jasg claggA

2 t
3 etun a hew atooy
Jangh 2 condainind
hir iddle ekmorts
t/
public.
ntrJ middlauay
(intiJa, înt[]b)

public Staic Void main

=
ClassA aobj ClagA)
t
mput 2
-I=
lo,20,30
TSult = aobj middieulay Çinpud d, input 2) 33

o! it data eut)
+
data )l6 2o

20
utput
a-8
Date
Page

pakae Compacki
ClagA
þullic. dass
he atS
* givern. nt agAQ., etBn
he .hle
utht olouble eh the axinal
element the
elemcts
ahd all the

makelast (int IJ num3)) / $A5,S4


aubhic ht ]

int
length]3
at

Vai iag
ulic statico
lasA ank heo clagA

aobj makelogt (input 1y

( it dta. yegut )
(data t )3L000,0,0

otpt
Bfeet We assmate
Once st
We ceated. we
want 6-08-20
canhot o Bjeet
odify tasy
Prsgln
Rublic Clasn
Voicd nheHd0

String s = Java

Joaua ")
Sring 62 = hew Sting (
chaot cotottJ= §Ja',va
Sbing s3
= nes Sting (a);
2
Sti ( aA, 2, 2)3
nden
Pusition
Syo(S "+ s);
Syo ( S2 + S2)
Syso ( s3 3) + $3 ):
S4

C)
Void eth

wich wete Created Shg Stig


| Sting
immutabe
s Java D.
Sing
Syso Befate concatihatioh s 4s):
Sygo( Concatthatoh regul o 1) 4
S'lohcat(5
IL S= S
oncat( iS aesmel alde auseBome
hatam
lgenme
SygoAHel concatinaton s
+s):
osled aog classmate
ne) Siect hees
tnein Dete

public static Vejd mn


-
he
Cuby meh i();
Syso(

Output
S2Jova
S4 Va aV
id

pLO)isi
lassMate
Date
Page

Sting String. SingBuildet


Bufet Casg

Stings colkc gpaup of chaladeg


Sbing Hadling 3- i
shoutd e
Eve srvg data
pae
3entn side.

Stáng Clsa- Stigs.


Clasx Qole immutable •

Tronulakiih Sinmutaaiiy Meahs Ohce we haue


a casg
Sting. oßjeat) e cont

mdity Confents new


CTealed
Be
Qld oBjet wil at Be effected the dangus

con enk. Sting woys


We.
by 4

Sig si=Tava
=
Shing $2 hew Stig (" Jaua)3Il Java
inden 3

s3 = hew Shing.( as); is bek


hich
nden wtten
S4- new String (aHt,,2); || ay
fnden poRHion
cJAssnate
Date
Page

Shing S= Java
Hoap Memcay

S= Sloncot (1S ouJalome) (Java


4S6

752

Java
Shig S= Casei
S= re)
Sti Shing
(Je) Casg.2

Heap Merncuo Sthing("pa

Si sthas
d
Stine s=Jaua
Jawa
Gtring. s2 : Jaua le SCP 53 |Stang sshew Striyl"Jave'
(Tava)
Sting s3=Htr)i14SD Sting se = heus String(Ox3c.
Html)
8=0Tode" (osuk
(4

Nole.& n scP thote is no chahe Dublicadego


of
alassMate
Date
Page

A
Uhdaclandig tbrnding -i Sthieg eslespts
Shing Shig

e refelenked Sting chjets in Jawg

Aflet a Shing chect


, cwe can't þeafm
Cating
the ensting oBject
to
2 we
hy chaingeg to tat
Be
string, those will

This Behauior fs called immutabily


of he Sting bhject

String ahjuh oje imnutale.

CroingShigt We delaea Sting. Vaniable

and diechy stogie a


ilestal obsiatost

Str Helo J.
Cseate
()l We
Can
Kome
stig
with

Stig St
he Srig ("Jaw);
we
Create chataetet

chat
cdassmate
Date
Page

(seak
a
s2= hew Sting. (saol)

hee
shjh chaydes

s3=new sbing o4 2, 8)
2nd chactade a total of
Hete atingfom

naan ag (Shixg Cohcalenshies


melgirg of
to stingg is
we can Con atinaih y usng (4)
pefosn oholahoh

asle

s= he)
Shig 6= Shing(Jn);
Then twp objeds. wl Be csealel
congtoat poal
the otho Ohe
sShing
SCP)

LShich is stesart tea memeyo


in the
alassnste
Date
Paqe

a n te folloang.
t we Coe Csahg Shig
yava ))
Shing S= sco
Then objetwill Be Creaked in
ohe
ahd s) that ojt.

auwag opton, al. 1st


objoct Cseaton ?nspis
chek any okjet ° alady
requimed
is
s
not
it t algcody.
neis
oBiedt

4 eristing.
oet not alcad thee then ody
objed
il te
be Csaedo Hehe theste is no

eisting2 olecksttSame, conkest

On SCp that is dagliate objeakg ate nat allss


SCP

*Clatboqe. callectoe can't ocess SCP astsa. hehce


eveh though oyject don't haue ahy
stit that
efeotehce
chetl is hoteliAle
fot plegehtSpo

AL sektenednde Scp objeas wil te destho

at hetime Jan Shatdoh oto mahia


SCP if alseady
tha.
2eUse hed
object o

thaze, Rs
ro chare of dpliok cheuk
classMAte
Date
Page

evet new
A hen we
ote using opolaost Comjule
n
he
oitBe (eako the.
Heap

Thee be a chabee of delicake objeda în


k
heah mernyo But thote is ho. chance deglicale
obfechsin SCP

Istresd ot cresting a sepaetak


Aduantage of SP
requirerenf we
reale ondy Ohe object and we xeUse,
Can
oljat fo eNey requiremort.
lame
Thig abjsoach mpoveo pestfotrnaKe Ghd

utilizahoh.

&avotal zefotehces
Dad,anbga of pohg
, e
do the sameobjet if
chenge the Valye
ofohe sefetence
Kefences pointirg to that obje will Be xefleted

thetnfn otlost to bstevent this stings. ate


classmate
ate
O-09-2
Page

casg methods-
Sig
Smpit fava- uttl-Scahn

eblic. ClassA

metht()

Syo("" Injlkmentiy Sting cas Metads ),


Jova
heo= Sting. ( Jawa")
Stings2
S3= (TaW )
Stio
Sting &+= hew Stóng
(KJav);
giavked.
checke
k|equals in shing clasg
the
equalec) ul
the Condehte shig
Syo (St equag(s2));
equalz (S3)|tne.
te
So (Si:
Sßo (s2 equalg (S4)); | tae
(Jav a equals (Jaa") )te
cqse
Syžo
(JAVA 2qual (s))3// false beoz java is
Sengitive:

t cill checka the Gotbleb8 Aocations of


stinglýcke
classMate

S|- ScP meró pate


>s2-ieap

SySo (S2== S3 alge.


syso (s) ==
4) || false He
(s2-= 4) || falee Bcoz diffeslont object cyelkel

Syo( =- $3)%/tne/l bsth in sP

scp and HoMp


Heah
SBo(Jawa= hew Stäng(Jaya))Ufke
Sy8oS2== Dao sting (JauQ")falke difet oye
in feas
- dngado

-
-")3
Jengh Vajabe

Jaglhc
Syso(" Jongh03
asegome.
Sygo( (C Concat () + st-lohcatts
13 ha -2 Spae
51); /Jaya
Syso(
Syso (
oi.4
chat)Dt S: cRaAt(3); a ttrce)

Syso (« doAtl)+ sl- datA (si. ehgth ()-2))lN


hezltha henta is
we want not
aatab
t
Stanne. Sc =new Sconnei(Sysem: in)

you
Syso( Peose endet gedet me):
Sting, dat, = SC-hert(
cha ghdeg data chaAt(o)

Swieh( gehde)

Sgso(UBet S
Male)

Case F':
eak
default a
Syso(SInvatd input)°
boteak

Slatstah) Jauq is aweSoe StE

Jawa 1S. aulome


Cohcat(s)))
classMAte

Dete
Page

Sysoto\owestCage (): ))
st
t&) Joua imutable:
lass is

+ S toU pel Ca3eU) )3// TAVA


=
Stirg. s5 love îndia )o
ubthring (ínta) ) +
s5. dia- Stathy
subting,()/|
inden to the endo
L

SysoSh stang (int a, întb ): +


s5. substingl2,6)|ae

(epace ().+
t sebloce(cqA)3| JAvA
Syo ("á1)ts1); Jave (stainge
Stings6 =Hello Word - spaxe.
Sygo So sb Jengh (l)13
cé( tm (3 "ss. taim ()
2
Jenght (0)3Il11.
SpoLe fom
Start anl and hst middle

Sygo ( nden0f ():+ 1-inden Of (a):/


+
last înden 0f ) &' lest Inden0f(a')i3

woid máin (Sting L


bublic. stati
hew (lassAC)
Data
O4/ og /22
Page tlo.
Shivalal
melhads
Sting clas
Mehod& Degcáphon

Sting coxat (stig sh) GoncateinteA callig Strg oth stoe


Nole - t aso Used -t do theSame

Retuwh Jergth of a Sting:


(uD Chat chos At (înt inden) Rehus the chaja<tol at seihed
Soaton (fromo)

(O bockorn equalg (Gtig st) Reton tle iF callig sting


equale Stro

ockon stoskbith (Ghiyy,


(Shing Pehn) Retusch oue 1f callirg sting stct
Loft) Pyefn

tolowel (ale() Cowexds all chataceg into lowt

Stbing kitoUppoGlel) ColNets all chootatetg înto uppexcase

(vii) nten) sbs This elod is usec te gt


ScP objet wth te
help of hesp objet 'refee(e

* boalan equolztgnet (oe (Strig S)


This mettod is used by contet
compasisoh Shete cefe iS
împosttat
Date
Page No.
(Sialal

Melhods Degcripio

begin
the subtaing
Retwths from
ing subgting (int Begib)
Bnden to encl. of the stig.
subthing fom
stng subzthig(itbegin, int osd) Ratuns the. to
egin îalen ehd-1 irde

Teplace eveyy old chtado


Stoirg. ephce(chay od, chetTo
heo hatacey.
,hes) itha a he

uged o remoue
This method is
Sting tim ()
bankspaces p|eent at
of the
beginbig and ed
but nat blank Spaces
|Stig
Preset at middle of
te

nt Bhdesn0F(cha d) rehuwnE fnclea of 1st occusteh Ce


of thc cfhaacly
spoci fic

theSpeifedchajatet is
if
aWailable -
hot then etwh
fnt lagrden Of(Chey ca) setusn Tnden of Oost ocaeehe
of the Speeified dhast aete
Oato
/9 /22•
Page No
{Shialal

þackoge

impot jaya util - Axtayg

public clasg ClassA

woid mehi
U

=
Sting dae ((
8/sep| 2022)

Stong. aHAL J = date• Splif (


Sya are ==t Arayg to Sting
(Gt1))",
Sting a99H2 = msq. split-(« )
Il Mg spli(

1 =
Sting asI3 dale-split(",2)
Syoc a1 ===)+ hrayg. to Sbing (at93))
syso ( -

((
Shing S- ABCDEF

Sygol
Reteivhg the dat fwm Byk daday

fot (
bte ar+)
Date
Page No.
Shivalal

syso(n + « »)
+

Voidl
public Statit

GlassAO: meth1()
heuw
Date
Page No.

(S/ivalal)

Given sting. name eg-3o,3estn a

gpeeing of the

Pragharn - publicdass ClaggA

Helo concat Chame)4|


|setuh
detusn Hello

moin (Shing C] coge)


bubic stot Void

ClassA claegA
Shing elult
= aobj elloname (Jaua)
Syso (3egut) HeloTawa

Oe Gveh to them Shingg ya ad xehoh the 3eault of


ogghet in the adet ab- ba
o

ByeHi

Rackoge comn- þacki

public clase JasgA

public makeAßka.(Stáng a, stang b)


Date
Page No.
{Shüvalal

þublic static

classA aob
=
hes clasAc)
==
anbi: (CH
make.Abba hb
Stingegult
xesult
Syto( xesu4) IL HiBye ByeHi

Oue- cheek the givon Loald fs balindo me o


n)

pubic Jass ClassA

Void meth
i (Shing 3)

if (s. egualg LghcsleCale (3e8))


Syso(" st ís a þalehdsome )

Syso ( H 3s not þalendsme):


publíc staic yoid Main

hew ClassA() methi( nGdarn):

?S a palindgoe
Date
/
Page tio
(Shivalal
iven out sting ength
4, sueh ag
as
Quet ahd.
a. cod xetuh he stirg. uhete te wcGd is
n the midd le. Of the.

Bogsan þublic class ClagsA

public Stainq. makoutwod ( Sing out, sting xe4)


d)

ehsn out: sukstirg, (0,2) twsid t ouh. substing,(2);

veid main
publicsttic
ClaseA acbj= new classA)

<
Syso (Yelt )9| Java>>

Loutput-< Java ate


Date
9 /09 /22
Page No.
Shivalal

Sting. clags, Sting.Baftot Stbing. Baider


Engan-
public clas3 ClassA

Void methi()

Shing Si = hew &hing. (4Java ")j


Sking Euffel bufet hew
=
StigsffelTaa
Shing Buitde buitdei hew

S: Concat (
Sawome
S=St Cohcat( is welome )
/
buffesid qhehd (is awelome ")

Syo(bing. daa +) l Taja.


/TaWa is
(StitBffei data? +byffeli): auvehrg

StingBuildeo dat t buides1) |Tavgis Qwesne

Void melth(
S1=
Staing.S1 hew Sting ("Jou ");
Sbing B4fey hyfet= hew
Sting Builde buitdeti : hew)

Staing
s2= heuw Sting. (Te ");

new
StiaBuildoi buildeg 2 Štbg Buitka(Jeun");
Date
Page No.
{Shivalal

SCp is a Speial memosy llocaked ondy


fot Sting
class oeiets Sheheve4. 094e
DR Sbingbuildet objects he creaked ingile
Heap Memey
*

shing uddot

Compazing Sbig
Stirg clagisteguols
clags (sa));/Taie

using == Qpoal on Shing class , Staing Bufkn clas


stig Builde cdaske
Syao(======z9)3
Syac(" Stig class+ st== S2)3lfalse

cJass y = =
Syco ( sting Bidde (buildott buildet2j) l(false

Ho
to hek the contenk eent neide Stoing Buffet
(Ot) Shing Builde.

Conpag====);
so Sygo
The content of ShirgByffe ==),
buffeoti to Sthingl) equala (bufleon 2-t String ())}
(2

bSting ) s wsed Because to objeet into


Content
Date
Page No.
(Shivala

þublic static void mam (Sbing I7 aR)


Clagg A Cobj
= hew
mnethi()
aob

mehe(R
L
Date
1o /9/222
Page No.
Shivalal )
VS VS Shigbuildle

Stirg3

StaugDuffot Shirguilky

Tmmtabte Mutable Muteble


i)

(i1) h:equalsc)() eugs


Adde2 tocaticn Addesg LDcaHon
Eonjend&
SgbchonzedNotsyghcnonized

com paski
public

Void meth i
sh=
sb= heu)
hew Gtbingßuffet0
singBffe
Sy30
3
sh apand( abcdefghijklmnap

Syeo
(" Jengths "t sb Jength6
Date

Page No.

Shivalal

Sb appehd(qr)w
Syso(sb +sb);.
theh
I| if Jengh is moHe Han Capoelty
=
(uopkit apily +1j*2 172.
syo(«
Syso ( -));
Syso ( chat At () "+ shchaciAt (sb- Jergth () -1);ilr
chaxAt ):+ Sb
sbo chot( sb: Jengthl-2)) I4

sb setesa Ato, A'):


+
sb)
+
Sygo (" delele (), sb delete)o, 2));LInd o,l4

Syso( sb )tsB)°ni

'he closRA(): Meth dc)

Output
Date
Page tNo.

(5hitalal

tim Bußel- a Conent frequertly


wants tu
dhen
chonge
is.
he

eLommeded t

mutable, so they
Shing Buffe objeaks ale
iu
CGseak heu) opAk
((b||We cah
and pase the sbing to the oBjed, a:
ka Sting Buffe Sb= he Sting B4ffet (Sujctha)
stbingRufa is 16 ?
v The defaudt ritiad cataáty of

() Afet enchhg ts manimum

uwcsert cataity +1) *2


(16+1) t2= 34,70
o
ooo
i•e-
Methods - T

StitgBufe

Melhalß Desc áphoh

int Jongh). Retuh the ho of chaoactess Psegent in


The sting- Buffed
po
it cajaaty0 Retuh haw many,
haatots a
Stingta ffet.

a at
iD cho cHat(nt indenj
Retns chotacden Socated

Spei fia inde


Date
Page No.
Shivalal

Methods chsciçkon
oaing
Void sefchat Atttr Replace
te charotet
SPed'fed.inden wth the avide!
at
inden, cha ch)
chastactot

O delele (int begin,îa| Delees chatet tom Begin iden


ehd end ninde•

inde Delels the chohtet ocaing. at


delelecheoA ((t
Speiked inden
(VID XeVese L) Reveke theigiven Shingbuffe

V Vod setlength (it knglh) Congide only Specifed no of

chasaclel8and 8emove all tte


emaining chasoike

Vod ehsute ncreoe


aoT
Cint iniHatapaatty
he casacily dyhamical
bas
Date

Page No.

(Shivalal

tSthingBuildea - wtl
te Baâng.
Same melhods as
of SbingDaffef exept the foltasng.
diffetencele

Stirg, Buffot Stángballdot


No methad
) Evey mehad þtescht în
in pAeent in ShigBild:

a one At a tine mulhiple fhiade


(BAt time pnly
Dy thed
thstead

Opetale alloned to oþatake


is aloLwedfo ale
the StingRuffey objet Simultanesslynon sbigBuidet
the
hehce Staing B
Da feA ohject ?s
otjete Hene stingBuilde is
Thtead safe notthatead c&e

( gt incseases oaithg tine Theads ae. hat yegued to


Of the Thstesd an tense ait and hehce xedatively
relatively pestfocnchKe PetfsmaKe kig
is
Hoo velsIon duced
todyceal n
s Vesion
Date

Page No.
Shivalal

Stin.
Stig is. immudable D
Aile StángBaffeo
ad Sthivg.

BuilosA

Sting Buffei is Syhchsoni zed hile sbirgBuilde is


hot Shich make stingnuide fasteHan

sting- Jou Yequie. inuntabiit


Use
utablet
tstead
USe Sthing Ruildo
Hholead safety

You might also like