13
Heap Stack String@42e816 str bira String@42e816 anotherStr String@3ecfff bi bi String@9ae764 ra ra String@7cdaf2 thirdString bira

Heap

Embed Size (px)

DESCRIPTION

Stack. Heap. str. bira. String @42e816. anotherStr. String @42e816. bi. bi. String @3ecfff. ra. ra. String @ 9ae764. thirdString. bira. String @ 7cdaf2. Stack. Heap. hello. Hello. string @ a8fe24. same. string @ a8fe24. Stack. Heap. str1. Hello. String @ 6e278a. str2. - PowerPoint PPT Presentation

Citation preview

Page 1: Heap

HeapStack

String@42e816

str

bira

String@42e816

anotherStr

String@3ecfff

bi

bi

String@9ae764

ra

ra

String@7cdaf2

thirdString

bira

Page 2: Heap

HeapStack

string@a8fe24

hello

Hello

string@a8fe24

same

Page 3: Heap

HeapStack

String@6e278a

str1

Hello

String@6e278a

str2

Page 4: Heap

HeapStack

string@6e278a

hel

Hel

string@2fa8fc

hello

Hello

string@a7b46e

copy

Hello

Page 5: Heap

HeapStack

string@6e278a

declared

Intern pool

string@6e278a

interned

string@a7b46e

built

Intern pool

Page 6: Heap

HeapStack

String@6e278a

str1

Hello

String@821a48

str2

Hello

Page 7: Heap

HeapStack

string@821a48

str

C # P r o g r a m m i n g C o u r s e

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21

Page 8: Heap

HeapStack

Cat@6e278a

someCat

(Cat members)

Page 9: Heap

HeapStack

Cat@6e278a

someCat name:String@a272e8

color:String@852fa4

Johny

brown

Page 10: Heap

HeapStack

Cat@6e278a

someCat name:String@a272e8

color:String@852fa4

Johny

brown

Page 11: Heap

String@7cdaf2

Integer@9ae764

HeapStack

42

i

ch

result

obj

42

str

Hello

(4 bytes)

A (2 bytes)

true (1 byte)

Integer(4 bytes)

String

[B@190d11

bytes

1 byte[]2 3

Page 12: Heap

String@9a787b

null

HeapStack

0

i

ch

result

obj

42

str

Hello

(4 bytes)

B (2 bytes)

false (1 byte)

Integer(4 bytes)

String

[B@190d11

bytes

1 byte[]0 3

Bye String

Page 13: Heap

H e l l o , C # !StringBuilder:

Length=9Capacity=15

Capacity

използван буфер(Length)

неизползван буфер