26.07.2013 Views

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

Java How to Program Fourth Edition - DCC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10 Strings and Characters 571<br />

Fig. Fig. 10.17 10.17 static character testing methods and case conversion methods of class<br />

Character (part 3 of 3).<br />

Line 64 uses Character method isDigit <strong>to</strong> determine whether character c is a<br />

defined Unicode digit. If so, the method returns true; otherwise, it returns false.<br />

Line 66 uses Character method is<strong>Java</strong>IdentifierStart <strong>to</strong> determine<br />

whether c is a character that can be used as the first character of an identifier in <strong>Java</strong>—i.e.,<br />

a letter, an underscore (_) or a dollar sign ($). If so, the method returns true; otherwise,<br />

it returns false. Line 68 uses method Character method is<strong>Java</strong>Identifier-<br />

Part <strong>to</strong> determine whether character c is a character that can be used in an identifier in<br />

<strong>Java</strong>—i.e., a digit, a letter, an underscore (_) or a dollar sign ($). If so, the method returns<br />

true; otherwise, it returns false.<br />

Line 69 uses method Character method isLetter <strong>to</strong> determine whether character<br />

c is a letter. If so, the method returns true; otherwise, it returns false. Line 71 uses<br />

method Character method isLetterOrDigit <strong>to</strong> determine whether character c is a<br />

letter or a digit. If so, the method returns true; otherwise, it returns false.<br />

Line 72 uses method Character method isLowerCase <strong>to</strong> determine whether character<br />

c is a lowercase letter. If so, the method returns true; otherwise, it returns false.<br />

Line 73 uses method Character method isUpperCase <strong>to</strong> determine whether character<br />

c is an uppercase letter. If so, the method returns true; otherwise, it returns false.<br />

Line 74 uses method Character method <strong>to</strong>UpperCase <strong>to</strong> convert the character c<br />

<strong>to</strong> its uppercase equivalent. The method returns the converted character if the character has<br />

an uppercase equivalent; otherwise, the method returns its original argument. Line 75 uses<br />

method Character method <strong>to</strong>LowerCase <strong>to</strong> convert the character c <strong>to</strong> its lowercase<br />

© Copyright 1992–2002 by Deitel & Associates, Inc. All Rights Reserved. 7/7/01

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!