86 Part (J2ee hosting) II: Writing Your Own Java Programs

86 Part II: Writing Your Own Java Programs only problem is that some of the Java API methods are geared specially toward 16-bit Unicode. Occasionally, this bites you in the back (or it bytes you in the back, as the case may be). If you re using a method to write Hello on the screen and H e l l oshows up instead, check the method s documentation for mention of Unicode characters. It s worth noticing that the two methods, Character.toUpperCaseand System.out.println, are used quite differently in Listing 4-4. The method Character.toUpperCaseis called as part of an initialization or an assignment statement, but the method System.out.printlnis called on its own. To find out more about this, see Chapter 7. The boolean type A variable of type booleanstores one of two values trueor false. Listing 4-5 demonstrates the use of a booleanvariable. The output of the program in Listing 4-5 is shown in Figure 4-6. Listing 4-5: Using the boolean Type import static java.lang.System.out; class ElevatorFitter2 { public static void main(String args[]) { out.println( True or False? ); out.println( You can fit all ten of the ); out.println( Brickenchicker dectuplets ); out.println( on the elevator: ); out.println(); int weightOfAPerson = 150; int elevatorWeightLimit = 1400; int numberOfPeople = elevatorWeightLimit / weightOfAPerson; boolean allTenOkay = numberOfPeople >= 10; out.println(allTenOkay); } }
Our Colorado hosting facilities are located in Little Rock, Colorado. Colorado web hosting datacenter which we have is linked on five major US backbones which gives you assurance that your site will be online 24/7 a day. More details you can find out in Web Hosting Colorado part.

Leave a Reply