84 Part II: Writing Your Own Java Programs (Web space)

84 Part II: Writing Your Own Java Programs Table 4-1 (continued) Type Name What a Literal Looks Like Range of Values int 42 2147483648 to 2147483647 long 42L 9223372036854775808 to 9223372036854775807 Decimal number types float 42.0F 3.4 1038 to 3.4 1038 double 42.0 1.8 10308 to 1.8 10308 Character type char A Thousands of characters, glyphs, and symbols Logical type boolean true true, false The types that you shouldn t ignore are int, double, char, and boolean. Previous sections in this chapter cover the intand doubletypes. So, this section covers charand booleantypes. The char type Not so long ago, people thought computers existed only for doing big number-crunching calculations. Nowadays, with word processors, nobody thinks that way anymore. So, if you haven t been in a cryogenic freezing chamber for the last 20 years, you know that computers store letters, punctuation symbols, and other characters. The Java type that s used to store characters is called char. Listing 4-4 has a simple program that uses the chartype. The output of the program of Listing 4-4 is shown in Figure 4-5. Listing 4-4: Using the char Type class CharDemo { public static void main(String args[]) { char myLittleChar = b ; char myBigChar = Character.toUpperCase(myLittleChar); System.out.println(myBigChar); } }
Don’t want to have just any web hosting, but web hosting provider who will share the same beliefs? You have found them. Our Church Web Hosting company will treat in you in appropriate way, the one you are accustomed to.

Leave a Reply