FIT1051 Lecture Notes - Lecture 5: Memory Address

60 views1 pages
Week 5
Thursday, 22 March 2018
7:00 PM
Value and Reference Types
Apart from primitive data types, the only other types we have come across are class types. A class
such as a Person class as well as being a recipe of data items and methods to make Person objects is
also a data type. Objects instantiated from the Person class are referenced by variables with the type
Person. Actually given that data types define a memory storage format and classes define a unique
set of instance variables the connection is obvious.
All primitive data types are value types all other types are reference types.
Variables are just a programmer friendly name for memory address. Actual addresses are a
sequence of 64 1's and 0's. Java translates our friendly names back and forth from these cryptic
addresses as required.
Variables of value types are addresses of the values they store.
Variables of reference types are addresses of addresses of the values they store.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Apart from primitive data types, the only other types we have come across are class types. A class such as a person class as well as being a recipe of data items and methods to make person objects is also a data type. Objects instantiated from the person class are referenced by variables with the type. Actually given that data types define a memory storage format and classes define a unique set of instance variables the connection is obvious. All primitive data types are value types all other types are reference types. Variables are just a programmer friendly name for memory address. Actual addresses are a sequence of 64 1"s and 0"s. Java translates our friendly names back and forth from these cryptic addresses as required. Variables of value types are addresses of the values they store.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents