COMP 110 Errors, Strings, and Review - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

COMP 110 Errors, Strings, and Review

Description:

Syntax error - grammatical mistake in your program ... Carriage return r. New line n. Backslash. Single quote. Double quote. 8. I/O (Input/Output) ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 18
Provided by: michele9
Category:

less

Transcript and Presenter's Notes

Title: COMP 110 Errors, Strings, and Review


1
COMP 110Errors, Strings, and Review
  • Tabitha Peck M.S.
  • January 28, 2008
  • MWF 3-350 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 FisherPixar Animation Studios
  • 1230 pmTuesday, January 29, 2008Sitterson 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
String output myString.substring(1, 7)
7
8
Escape Characters
  • System.out.println(How do I put \quotes\ in my
    string?)

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
Write a Comment
User Comments (0)
About PowerShow.com