Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMP 110 Errors, Strings, and Review Tabitha Peck M.S. January 28, 2008 MWF 3-3:50 pm Philips 367 1.

Similar presentations


Presentation on theme: "COMP 110 Errors, Strings, and Review Tabitha Peck M.S. January 28, 2008 MWF 3-3:50 pm Philips 367 1."— Presentation transcript:

1 COMP 110 Errors, Strings, and Review Tabitha Peck M.S. January 28, 2008 MWF 3-3:50 pm Philips 367 1

2 Announcements Project 1 Due Wednesday Lab 1 Grades Resubmit Lab2 if you want 2

3 PIXAR: Technical Challenges in the Production Pipeline Susan Fisher Pixar Animation Studios 12:30 pm Tuesday, January 29, 2008 Sitterson Hall 011

4 Questions? 4

5 Today in COMP 110 Errors Strings Review 5

6 Errors Syntax error - grammatical mistake in your program Run-time error - error that is detected when your program is run Logic error - the output of your program is incorrect

7 String Indices UNCisGreat 01234567891011 String output = myString.substring(1, 7); 7

8 Escape Characters System.out.println(“How do I put \“quotes\” in my string?”); \”Double quote \’Single quote \\Backslash \nNew line \rCarriage return \tTab 8

9 I/O (Input/Output) System.out.print(“this is a string”); System.out.println(“this is a string”); What is the difference? 9

10 Keyboard Input Scanner Scanner_object_name = new Scanner(System.in); Scanner_object_name.nextLine(); Scanner_object_name.nextInt(); Scanner_object_name.nextDouble(); See p. 93 Make sure to read Gotcha on p. 95 10

11 Documentation and Style Meaningful names Indenting Documentation Defined Constants 11

12 Defined constants public static final Type Variable = Constant; Named in ALL_CAPS public class DefinedConstant { public static final double PI = 3.14159; public static void main(String[] args) { 12

13 Wednesday Read 3.1 Project 1 Due 13

14 Java is an OOP language Object-Oriented Programming Language Objects and methods

15 Encapsulation “Information hiding” Putting things in a capsule Methods in the String class myString.length();

16 Polymorphism Many forms int + int double + double String + String

17 Inheritance Organizing classes so properties only have to be defined once


Download ppt "COMP 110 Errors, Strings, and Review Tabitha Peck M.S. January 28, 2008 MWF 3-3:50 pm Philips 367 1."

Similar presentations


Ads by Google