Zeus web server - 56 Part I: Getting Started When I say
Wednesday, October 31st, 200756 Part I: Getting Started When I say things like System.out.printlnis buried inside the API, I m not doing justice to the API. True, you can ignore all the nitty-gritty Java code inside the API. All you need to remember is that System.out.printlnis defined somewhere inside that code. But I m not being fair when I make the API code sound like something magical. The API is just another bunch of Java code. The statements in the API that tell the computer what it means to carry out a call to System.out.printlnlook a lot like the Java code in Listing 3-1. In Java, each statement (like the boxed line in Figure 3-4) ends with a semicolon. Other lines in Figure 3-4 don t end with semicolons, because the other lines in Figure 3-4 aren t statements. For instance, the method header (the line with the word main in it) doesn t directly tell the computer to do anything. The method header announces, Just in case you ever want to do main, the next few lines of code tell you how you ll do it. Every complete Java statement ends with a semicolon. class Displayer { public static void main(String args[]) { System.out.println(”You’ll love Java!”); } } public void println(String s) { ensureOpen(); textOut.write(s); textOut.flushBuffer(); … } The computer calls yourmain method automatically, then… …a statement in yourmain method calls the System.out.println method. 101010000111000… Somewhere inside the JavaAPI… Figure 3-5: Calling the System. out. println method.
We provide special commissions and earns up to $125 us per referral for all website hosting directories. With such big commissions you should immediately sign up for our affiliate program for website hosting directory sites.