1620_lecture_5 - ITEC3620 Object-Based Programming Lecture...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
ITEC3620 Object-Based Programming Lecture 5 Working with Data
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Declaring Variables <datatype><identifier / variable name>; int myNumber; Declaring a variable does three things Defines a new identifier Specifies its datatype Allocates / binds it to a space in memory
Background image of page 2
3 Primitive datatypes byte - 8 bits short - 16 bits int - 32 bits long - 64 bits float - 32 bits double - 64 bits boolean true / false char 16 bits (unicode)
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Declaration allocates spaces in memory myNumber Assignment copies values into them myNumber = 5; myNumber Declaration and Assignment 5
Background image of page 4
5 int anotherInt = 7; anotherInt double firstFloat = 1.6; firstFloat double secondFloat = firstFloat; secondFloat Declaration and Assignment II 7 1.6 1.6
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Style All identifiers in JAVA have a proper style guide/naming convention Identifiers that are not loop counters or math symbols should never be a single character Identifiers should be all lower case except for the first letter of each additional word Identifiers should not use underscores Identifiers cannot start with numbers and cannot use most non-alphanumeric symbols
Background image of page 6
7 Computer Assignment vs. Mathematical Equating Assignment copies values, it does not equate symbols firstFloat = 0.2; firstFloat secondFloat 1.6 0.2
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 28

1620_lecture_5 - ITEC3620 Object-Based Programming Lecture...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online