CharacterDemo - File CharacterDemo.java Author Amber Settle...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// File: CharacterDemo.java // Author: Amber Settle // Course: CSC 211 // Purpose: This application demonstrates the use of methods in // the String and Character classes / // Use a static import statement to simplify // references to the Character class methods import static java.lang.Character.*; i public class CharacterDemo { public static void main(String[] args) { String strOne = new String("Hello. What is your name?"); S System.out.println("The first String is \"" + strOne + "\""); S System.out.println("The first letter is: " + strOne.charAt(0)); S System.out.println("The first letter is upper case: " + isUpperCase(strOne.charAt(0))); i System.out.println("The first letter is lower case: " + isLowerCase(strOne.charAt(0))); i System.out.println(); S // How would we check whether the first character in the String // is a letter? // How would we check whether the last character in the String // is a space? / // Create a new String with all lower case letters String strTwo = strOne.toLowerCase();
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 2

CharacterDemo - File CharacterDemo.java Author Amber Settle...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online