0% found this document useful (0 votes)
7 views9 pages

Core Java

Uploaded by

Vikas NS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views9 pages

Core Java

Uploaded by

Vikas NS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Classes

table
① State
of the can't be
changed

[ake te VariablesPricea

#changedodat
so that once
assigned it can't be

a
cmodify
te oe

copies ele in
is
↓ I return de
Marktoalfinal sothat
a

overr, den

③ Downside -
You'll -
have too
many
objects
① When should
you
use it
?
·

They are thread


safe
Laching it doesnt
change
· as
= >
Difference Between ==&. equal
① JavaObjects

① = =
Always checks the
is True
reference e. A = B=

if
hold
they referenco
object
① .

equale @ By befaut the behavior


is same as =

Itcanbeorde
a

② Sting object
& equals checks the
overridden
reference
and checks the
contents
of 2
objects
.

③ Primities
① = = checks the contents

② .

equal
- not applicable
Sting Literal v/s Sting Object
O Sting Object => new
string("s") heap
= stond in
heap obj -

=>
962 Sting objects one
created with same value
in
> there
-
will be 2 objects
Leap
Leteral
② Sting "s
"
==

>
-
Stand in Literal pool

Water a
=
aue
exits in
pool with
only
1
both the
pointing to
name
Premities us Objects
① Primities
>
-
Basicbuilding blocks
>
-
Fixed ege
the
> stored in state of
-

thread unless static

② objects >
-

composed of primia
a
>
-
Deep Copy & Shallow
Copy
=> Both are
object copies and not

reference Copiesrates a new object

Shallow
>
Create anotpy mainactual obsets
-

Deep Copy
Everything last a
>
-
the
pumi

In immulable classes
Usage - to create a with
copy
same value

both shall a
Layy Copy=
Combination of
>
Inner
Working of Hash Map

Purpose

For a
a add()
guay
Pea
Mince
away
. an

Impl
inden
· >hash
-
(key) % n =

#(118 n -

collusion
o

It name
fraid no
is

eleSeparate
Worst Case Scenario

=>
Bad Hushing
Rame
algo
under
- all
point
=
7 Onl
Search Tree
=>
Usage of Binary
=> of logn)
·I

You might also like