Midterm Review1.4

Midterm Review1.4 - L a s t U p d a t e d 1 7 1 1 1 4 A M C...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: L a s t U p d a t e d : 1 / 7 / 1 1 : 1 4 A M C S E 2 1 1 P r o f . J . E l d e r- 1 6- A r r a y s i n J a v a ¡ S i n c e a n a r r a y i s a n o b j e c t , t h e n a m e o f t h e a r r a y i s a c t u a l l y a r e f e r e n c e ( p o i n t e r ) t o t h e p l a c e i n m e m o r y w h e r e t h e a r r a y i s s t o r e d . ¢ r e f e r e n c e t o a n o b j e c t h o l d s t h e a d d r e s s o f t h e a c t u a l o b j e c t ¡ E x a m p l e [ a r r a y s a s o b j e c t s ] i n t [ ] A = { 1 2 , 2 4 , 3 7 , 5 3 , 6 7 } ; i n t [ ] B = A ; B [ 3 ] = 5 ; ¡ E x a m p l e [ c l o n i n g a n a r r a y ] i n t [ ] A = { 1 2 , 2 4 , 3 7 , 5 3 , 6 7 } ; i n t [ ] B = A . c l o n e ( ) ; B [ 3 ] = 5 ; 1 2 2 4 3 7 5 3 6 7 1 2 2 4 3 7 5 6 7 1 2 2 4 3 7 5 3 6 7 1 2 2 4 3 7 5 3 6 7 1 2 2 4 3 7 5 3 6 7 1 2 2 4 3 7 5 6 7 A B A B A B A B L a s t U p d a t e d : 1 / 7 / 1 1 : 1 4 A M C S E 2 1 1 P r o f . J . E l d e r- 1 7- E x a m p l e E x a m p l e [ 2 D a r r a y i n J a v a = a r r a y...
View Full Document

This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Page1 / 5

Midterm Review1.4 - L a s t U p d a t e d 1 7 1 1 1 4 A M C...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online