Deadlines - PowerPoint PPT Presentation

1 / 2
About This Presentation
Title:

Deadlines

Description:

syntax diagrams and 'well-formed strings' characters and character codes ... More Than One Way to Build a String. int i = 17 ; // Using the operator ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 3
Provided by: Steve57
Category:

less

Transcript and Presenter's Notes

Title: Deadlines


1
01-13
  • Deadlines
  • Assignment 2 due 1/18
  • Last time
  • Input from files and strings
  • Command-line arguments
  • The String class
  • syntax diagrams and "well-formed strings"
  • characters and character codes
  • positional sequences and subsequences
  • This time
  • a couple of String examples
  • mutating versus copying operations
  • variables and constants
  • numbers and other primitive things

2
More Than One Way to Build a String
int i 17 // Using the operator
System.out.println("The answer is " i) //
Building the string from "left to
right" System.out.println ("The".concat("
").concat("answer").concat(" ").concat("is").conca
t(" ") i) // Building the string from
"right to left" System.out.println
("The".concat(" ".concat("answer".concat("
".concat("is".concat(" "))))) i)
  • Questions
  • Why the (informal) comment "left to right" vs.
    "right to left"?
  • Why do all three feature " i" at the end?
    Could we replace that with another
    call to concat()?
Write a Comment
User Comments (0)
About PowerShow.com