Lecture04 - COSC 1046 - 08F - J. Rajnovich Lecture #4:...

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

View Full Document Right Arrow Icon
Lecture #04 Page 1 of 6 Revised Sep 15, 2008 COSC 1046 --- 08F --- J. Rajnovich Lecture #4: Monday, September 15, 2008 Topic: Java Primitive Data Types and Operators Assigned Readings: Gaddis, Chapter 2.4-2.6 Today we use NetBeans to create, compile and test a number of Java programs to illustrate important programming concepts from Chapter 2. - you will observe that every program we write today starts from the basic “minimal Java program” template we created in Lecture #2. Observe too how we use the NetBeans GUI to navigate the Windows file system. - please take notes as I demonstrate, to remind you of the key concepts and programming steps presented in these worked examples. - I do not fill up my pre-prepared lecture notes with detailed point-by-point discussion of the programs we examine in class. - I reserve the right to expand on any topic which I deem relevant as I lecture and get feedback from the class. - you are responsible for taking good notes and asking questions. - after the lecture I will place the full source code for each programming example discussed in class on the course web site. Java Data Types and Operators Gaddis covers the Java primitive data types in Section 2.4. Data values and variables of these types are called primitive for two reasons: a) they are not stored in RAM as objects of some class but rather as raw values occupying a predetermined number of bytes. b) the RAM location associated with the variable name holds the actual value of the type. In contrast, a variable which names an object of a class is called a reference variable and classes are called reference types . the RAM location associated with the variable name holds not the object itself but rather a numeric address; i.e. the reference to where the object itself can be found in RAM. So, a primitive variable holds the data value itself, while a reference variable holds the address or pointer to the location of the data object.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Lecture #04 Page 2 of 6 Revised Sep 15, 2008 Memorize Gaddis’s Figures 2-7 and 2-8 on page 69 which illustrate the difference between primitive data storage in RAM and reference data storage in RAM. as an example of a reference data type we will take a first look at the
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Lecture04 - COSC 1046 - 08F - J. Rajnovich Lecture #4:...

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

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