











































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












































String color = "blue";
String s1 = new String("hello ");
char chs[] = {‘a’, ‘n’, ‘d’, ‘y’}; String s2 = new String(chs);
String s3 = s1 + s2 + " davison"; // + is string concatenation
Four different ways (there are more). 1
2
"hello "
s
continued Docsity.com
for text analysis
String w = "foo"; String newW = w + "bar"; w = newW;
String w = "foo"; w = w + "bar";
"foo"
w
String[] msgs = new String[2];
msgs[0] = "hello";
msgs[1] = new String("hi");
String t = msgs[1];
t.toLowerCase();
msgs[1].toLowerCase();
t = msgs[1].toLowerCase();
What is built?
What is changed?
Input
Processing
Response
InputReader
Responder
SupportSystem
printWelcome();
String line, response boolean finished = false; while (!finished) { line = inputReader.getInput( ); if (line.startsWith("bye")) // time to stop finished = true; else { response = responder.genResponse (line) System.out.println( response ); } } printGoodbye();
Input
Processing and Response
InputReader
Responder