12-feb27

12-feb27 - COMP 110 Objects and References Tabitha Peck...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: COMP 110 Objects and References Tabitha Peck M.S. February 27, 2008 MWF 3-3:50 pm Philips 367 1 Announcements Lab 5 due Friday Program 3 due Tuesday at midnight Recitation - work on Program 3 Midterm - next Friday 2 Questions? 3 Today in COMP 110 Strings, Classes, and Memory Property.java updated on web Objects and References 4 Strings “Strings are constant; their values cannot be changed after they are created.” Java.sun.com s1 = s2; s1 = “how are you?” System.out.print(s2); Creates new variable in memory named s1. You can no longer access initial s1. Can’t change s2 because strings are constant. Nothing cool going on here. 5 Strings Declaring and initializing strings String s1 = “a string”; String s2 = new String(“a string”); How to set two strings equal (in value) String s3 = new String(s2); 6 Objects in Memory 5 3.14159 2078 1056 Name: Tom Age: 20 int num float num2 Person p1...
View Full Document

This note was uploaded on 02/02/2009 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

Page1 / 14

12-feb27 - COMP 110 Objects and References Tabitha Peck...

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