Strings, Inputs and Outputs Topic 4.3.6 / Core
- how to manipulate strings of text;
- how to input and output data in Java.
- Eck chapter 2
- A tutorial on
What is a
- Presentation on Strings, Inputs and OUtput
- Here's a program that uses
Strings. Save Target As, then open in BlueJ, compile and run. Look at the code, especially at the way the
Stringliterals are concatenated (strung together) in the output lines.
Note that this project has some extra code at the bottom - don't touch it as it lets you do the inputting and simplifies the outputting.
- Expand the program to input the user's age (as an
int) and their phone number (as a
- Try some of the ways of manipulating
Stringsdescribed in the presentation as you experiment with
- Extension work. Given the
Stringmethods listed in this document, what would be the results of these calls?
name.concat(" the Frog")
nameis back to "Albert"
- Work through the problems in the Java Problem Set 1<.
- Try some of the programming exercises at the end of Eck's chapter 2.