Archive for April, 2007

48 Introduction to (Web hosting reviews) Computers, the Internet and the

Wednesday, April 25th, 2007

48 Introduction to Computers, the Internet and the Web Chapter 1 Computer languages may be divided into three general types: machine languages, assembly languages and high-level languages. Any computer can directly understand only its own machine language. Machine languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct computers to perform their most elementary operations one at a time. Machine languages are machine dependent. English-like abbreviations formed the basis of assembly languages. Translator programs called assemblers convert assembly-language programs to machine language at computer speeds. Compilers translate high-level language programs into machine-language programs. High-level languages (like Java) contain English words and conventional mathematical notations. Interpreter programs directly execute high-level language programs without the need for compiling those programs into machine language. Although compiled programs execute much faster than interpreted programs, interpreters are popular in program-development environments in which programs are recompiled frequently as new features are added and errors are corrected. Objects are essentially reusable software components that model items in the real world. Modular, object-oriented design and implementation approaches make software-development groups more productive than is possible with previous popular programming techniques such as structured programming. Object-oriented programs are often easier to understand, correct and modify. Java originated at Sun Microsystems as a project for intelligent consumer-electronic devices. When the World Wide Web exploded in popularity in 1993, Sun people saw the immediate potential of using Java to create Web pages with so-called dynamic content. Java is now used to create Web pages with dynamic and interactive content, to develop large-scale enterprise applications, to enhance the functionality of Web servers, to provide applications for consumer devices and so on. Java programs consist of pieces called classes. Classes consist of pieces called methods that perform tasks and return information when they complete their tasks. Most Java programmers use rich collections of existing classes in Java class libraries. FORTRAN (FORmula TRANslator) was developed by IBM Corporation between 1954 and 1957 for scientific and engineering applications that require complex mathematical computations. COBOL (COmmon Business Oriented Language) was developed in 1959 by a group of computer manufacturers and government and industrial computer users. COBOL is used primarily for commercial applications that require precise and efficient manipulation of large amounts of data. Pascal was designed at about the same time as C. It was created by Professor Nicklaus Wirth and was intended for academic use. Basic was developed in 1965 at Dartmouth College as a simple language to help novices become comfortable with programming. Structured programming is a disciplined approach to writing programs that are clearer than unstructured programs, easier to test and debug and easier to modify. The Ada language was developed under the sponsorship of the United States Department of Defense (DOD) during the 1970s and early 1980s. One important capability of Ada is called multitasking; this allows programmers to specify that many activities are to occur in parallel. Most high-level languages including C and C++ generally allow the programmer to write programs that perform only one activity at a time. Java, through a technique called multithreading, enables programmers to write programs with parallel activities. The Internet was developed more than three decades ago with funding supplied by the Department of Defense. Originally designed to connect the main computer systems of about a dozen universi Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: In case you are looking for affordable webhost to host and run your web application check Vision cheap hosting services

Unable to start debugging on the web server - Chapter 1 Introduction to Computers, the Internet and

Wednesday, April 25th, 2007

Chapter 1 Introduction to Computers, the Internet and the Web 47 The various devices that comprise a computer system (such as the keyboard, screen, disks, memory and processing units) are referred to as hardware. The computer programs that run on a computer are referred to as software. The input unit is the receiving section of the computer. It obtains information (data and computer programs) from various input devices and places this information at the disposal of the other units so that the information may be processed. The output unit is the shipping section of the computer. It takes information processed by the computer and places it on output devices to make it available for use outside the computer. The memory unit is the rapid access, relatively low-capacity warehouse section of the computer. It retains information that has been entered through the input unit so that the information may be made immediately available for processing when it is needed and retains information that has already been processed until that information can be placed on output devices by the output unit. The arithmetic and logic unit (ALU) is the manufacturing section of the computer. It is responsible for performing calculations such as addition, subtraction, multiplication and division and for making decisions. The central processing unit (CPU) is the administrative section of the computer. It is the computer s coordinator and is responsible for supervising the operation of the other sections. The secondary storage unit is the long-term, high-capacity warehousing section of the computer. Programs or data not being used by the other units are normally placed on secondary storage devices (such as disks) until they are needed, possibly hours, days, months or even years later. Early computers were capable of performing only one job or task at a time. This form of computer operation often is called single-user batch processing. Software systems called operating systems were developed to help make it more convenient to use computers. Early operating systems managed the smooth transition between jobs and minimized the time it took for computer operators to switch between jobs. Multiprogramming involves the simultaneous operation of many jobs on the computer the computer shares its resources among the jobs competing for its attention. Timesharing is a special case of multiprogramming in which dozens or even hundreds of users share a computer through terminals. The computer runs a small portion of one user s job, then moves on to service the next user. The computer does this so quickly that it might provide service to each user several times per second, so programs appear to run simultaneously. An advantage of timesharing is that the user receives almost immediate responses to requests rather than having to wait long periods for results, as with previous modes of computing. In 1977, Apple Computer popularized the phenomenon of personal computing. In 1981, IBM introduced the IBM Personal Computer. Almost overnight, personal computing became legitimate in business, industry and government organizations. Although early personal computers were not powerful enough to timeshare several users, these machines could be linked together in computer networks, sometimes over telephone lines and sometimes in local area networks (LANs) within an organization. This led to the phenomenon of distributed computing, in which an organization s computing is distributed over networks to the sites at which the real work of the organization is performed. Today, information is shared easily across computer networks where some computers called file servers offer a common store of programs and data that may be used by client computers distributed throughout the network hence the term client/server computing. Java has become the language of choice for developing Internet-based applications (and for many other purposes). Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services

46 Introduction to Computers, the Internet and the (Hp web site)

Tuesday, April 24th, 2007

46 Introduction to Computers, the Internet and the Web Chapter 1 Section 17.11 (Optional) Discovering Design Patterns: Design Patterns Used in Packages java.io and java.net Using the material on files, streams and networking in Chapters 16 and 17, we investigate some examples of pattern use in packages java.io and java.net. We discuss how these classes use the Abstract Factory, Decorator and Facade design patterns. We also consider architectural patterns, which specify a set of subsystems aggregates of objects that each collectively comprise a major system responsibility and how these subsystems interact with each other. We discuss the popular Model-View-Controller and Layers architectural patterns. Section 21.12 (Optional) Discovering Design Patterns: Design Patterns Used in Package java.util Using the material on data structures and collections in Chapters 19, 20 and 21, we investigate pattern use in package java.util. We discuss how these classes use the Prototype and Iterator design patterns. This section concludes the discussion on design patterns. After finishing the Discovering Design Patterns material, you should be able to recognize and use key design patterns and have a better understanding of the workings of the Java API. After completing this material, we recommend that you move on to the gang-of-four book. Well, there you have it! We have worked hard to create this book and its optional Cyber Classroom version. The book is loaded with live-code examples, programming tips, self-review exercises and answers, challenging exercises and projects, and numerous study aids to help you master the material. Java is a powerful programming language that will help you write programs quickly and effectively. And Java is a language that scales nicely into the realm of enterprise-systems development to help organizations build their key information systems. As you read the book, if something is not clear, or if you find an error, please write to us at deitel@deitel.com. We will respond promptly, and we will post corrections and clarifications on our Web site, www.deitel.com We hope you enjoy learning with Java How to Program: Fourth Edition as much as we enjoyed writing it! SUMMARY Software controls computers (often referred to as hardware). Java is one of today s most popular software-development languages. Java was developed by Sun Microsystems. Sun provides an implementation of the Java 2 Platform, Standard Edition called the Java 2 Software Development Kit (J2SDK), version 1.3.1 that includes the minimum set of tools you need to write software in Java. Java is a fully object-oriented language with strong support for proper software-engineering techniques. A computer is a device capable of performing computations and making logical decisions at speeds millions, even billions, of times faster than human beings can. Computers process data under the control of sets of instructions called computer programs. These computer programs guide the computer through orderly sets of actions specified by people called computer programmers. Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: If you are looking for reliable webhost to maintain and run your java application check Vision java hosting services

Chapter 1 Introduction to Computers, the (Web file server) Internet and

Tuesday, April 24th, 2007

Chapter 1 Introduction to Computers, the Internet and the Web 45 this section, we implement that model in Java. Using all the UML diagrams we created, we present the Java classes necessary to implement the model. We apply the concepts of object-oriented design with the UML and object-oriented programming and Java that you learned in the chapters. Appendix I Elevator View [Note: This appendix is on the CD that accompanies this book.] The final section implements how we display the model from Appendix H. We use the same approach to implement the view as we used to implement the model we create all the classes required to run the view, using the UML diagrams and key concepts discussed in the chapters. By the end of this section, you will have completed an industrial-strength design and implementation of a large-scale system. You should feel confident tackling larger systems, such as the 8000-line Enterprise Java case study we present in our companion book Advanced Java 2 Platform How to Program and the kinds of applications that professional software engineers build. Hopefully, you will move on to even deeper study of object-oriented design with the UML. 1.19 (Optional) A Tour of the Discovering Design Patterns Sections Our treatment of design patterns is spread over five optional sections of the book. We overview those sections here. Section 9.24 (Optional) Discovering Design Patterns: Introducing Creational, Structural and Behavioral Design Patterns This section provides tables that list the sections in which we discuss the various design patterns. We divide the discussion of each section into creational, structural and behavioral design patterns. Creational patterns provide ways to instantiate objects, structural patterns deal with organizing objects and behavioral patterns deal with interactions between objects. The remainder of the section introduces some of these design patterns, such as the Singleton, Proxy, Memento and State design patterns. Finally, we provide several URLs for further study on design patterns. Section 13.18 (Optional) Discovering Design Patterns: Design Patterns Used in Packages java.awt and javax.swing This section contains most of our design-patterns discussion. Using the material on Java Swing GUI components in Chapters 12 and 13, we investigate some examples of pattern use in packages java.awt and javax.swing. We discuss how these classes use the Factory Method, Adapter, Bridge, Composite, Chain-of-Responsibility, Command, Observer, Strategy and Template Method design patterns. We motivate each pattern and present examples of how to apply them. Section 15.13 (Optional) Discovering Design Patterns: Concurrent Design Patterns Developers have introduced several design patterns since those described by the gang of four. In this section, we discuss concurrency design patterns, including Single-Threaded Execution, Guarded Suspension, Balking, Read/Write Lock and Two-Phase Termination these solve various design problems in multithreaded systems. We investigate how class java.lang.Thread uses concurrency patterns. Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

44 Introduction to Computers, the Internet and the (Hosting web)

Tuesday, April 24th, 2007

44 Introduction to Computers, the Internet and the Web Chapter 1 lation itself this set of scenarios is called a use case. We model these interactions, using use-case diagrams of the UML. We then discuss the graphical user interface for our simulation, using our use-case diagrams. Section 13.17 (Optional Case Study) Thinking About Objects: Model-View-Controller We designed our system to consist of three components, each having a distinct responsibility. By this point in the case study, we have almost completed the first component, called the model, which contains data that represent the simulation. We design the view the second component, dealing with how the model is displayed in Section 22.8. We design the controller the component that allows the user to control the model in Section 12.16. A system such as ours that uses the model, view and controller components is said to adhere to Model-View-Controller (MVC) architecture. In this section, we explain the advantages of using this architecture to design software. We use the UML component diagram to model the three components, then implement this diagram as Java code. Section 15.12 (Optional Case Study) Thinking About Objects: Multithreading In the real world, objects operate and interact concurrently. Java is a multithreaded language, which enables the objects in our simulation to act seemingly independently from each other. In this section, we declare certain objects as threads to enable these objects to operate concurrently. We modify the collaboration diagram originally presented in Section 7.10 (and modified in Section 10.22) to incorporate multithreading. We present the UML sequence diagram for modeling interactions in a system. This diagram emphasizes the chronological ordering of messages. We use a sequence diagram to model how a person inside the simulation interacts with the elevator. This section concludes the design of the model portion of our simulation. We design how this model is displayed in Section 22.9, then implement this model as Java code in Appendix H. Section 22.9 (Optional Case Study) Thinking About Objects: Animation and Sound in the View This section designs the view, which specifies how the model portion of the simulation is displayed. Chapter 18 presents several techniques for integrating animation in programs, and Chapter 22 presents techniques for integrating sound. Section 22.9 uses some of these techniques to incorporate sound and animation into our elevator simulation. Specifically, this section deals with animating the movements of people and our elevator, generating sound effects and playing elevator music when a person rides the elevator. This section concludes the design of our elevator simulation. Appendices G, H and I implement this design as a 3,594-line, fully operational Java program. Appendix G Elevator Events and Listener Interfaces [Note: This appendix is on the CD that accompanies this book.] As we discussed in Section 10.22, several objects in our simulation interact with each other by sending messages, called events, to other objects wishing to receive these events. The objects receiving the events are called listener objects these must implement listener interfaces. In this section, we implement all event classes and listener interfaces used by the objects in our simulation. Appendix H Elevator Model [Note: This appendix is on the CD that accompanies this book.] The majority of the case study involved designing the model (i.e., the data and logic) of the elevator simulation. In Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

Chapter 1 Introduction to Computers, the Internet and (Web proxy server)

Tuesday, April 24th, 2007

Chapter 1 Introduction to Computers, the Internet and the Web 43 laborations messages that objects send to each other to communicate. The class operations that we discovered in Section 6.16 turn out to be the collaborations among the objects in our system. We determine the collaborations in our system, then collect them into a collaboration diagram the UML diagram for modeling collaborations. This diagram reveals which objects collaborate and when. We present a collaboration diagram of the people entering and exiting the elevator. Section 8.17 (Optional Case Study) Thinking About Objects: Starting to Program the Classes for the Elevator Simulation In this section, we take a break from designing the behavior of our system. We begin the implementation process to emphasize the material discussed in Chapter 8. Using the UML class diagram of Section 3.7 and the attributes and operations discussed in Sections 4.14 and 6.16, we show how to implement a class in Java from a design. We do not implement all classes because we have not completed the design process. Working from our UML diagrams, we create code for the Elevator class. Section 9.23 (Optional Case Study) Thinking About Objects: Incorporating Inheritance into the Elevator Simulation Chapter 9 begins our discussion of object-oriented programming. We consider inheritance classes sharing similar characteristics may inherit attributes and operations from a base class. In this section, we investigate how our elevator simulation can benefit from using inheritance. We document our discoveries in a class diagram that models inheritance relationships the UML refers to these relationships as generalizations. We modify the class diagram of Section 3.7 by using inheritance to group classes with similar characteristics. We continue implementing the Elevator class of Section 8.17 by incorporating inheritance. Section 10.22 (Optional Case Study) Thinking About Objects: Event Handling In this section, we include interfaces necessary for the objects in our elevator simulation to send messages to other objects. In Java, objects often communicate by sending an event a notification that some action has occurred. The object receiving the event then performs an action in response to the type of event received this is known as event handling. In Section 7.10, we outlined the message passing, or the collaborations, in our model, using a collaboration diagram. We now modify this diagram to include event handling, and, as an example, we explain in detail how doors in our simulation open upon the elevator s arrival. Section 11.10 (Optional Case Study) Thinking About Objects: Designing Interfaces with the UML In this section, we design a class diagram that models the relationships between classes and interfaces in our simulation the UML refers to these relationships as realizations. In addition, we list all operations that each interface provides to the classes. Lastly, we show how to create the Java classes that implement these interfaces. As in Section 8.17 and Section 9.23, we use class Elevator to demonstrate the implementation. Section 12.16 - (Optional Case Study) Thinking About Objects: Use Cases Chapter 12 discusses user interfaces that enable a user to interact with a program. In this section, we discuss the interaction between our elevator simulation and its user. Specifically, we investigate the scenarios that may occur between the application user and the simu Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision personal web hosting services

42 Introduction to Computers, the Internet and the (Web site hosting)

Monday, April 23rd, 2007

42 Introduction to Computers, the Internet and the Web Chapter 1 cuss how the UML will facilitate the design process in subsequent Thinking About Object sections by providing us with several types of diagrams to model our system. Finally, we provide a list of URL and book references on object-oriented design with the UML. You might find these references helpful as you proceed through our case-study presentation. Section 3.8 (Optional Case Study) Thinking About Objects: Identifying the Classes in the Problem Statement In this section, we design the elevator-simulation model, which represents the operations of the elevator system. We identify the classes, or building blocks, of our model by extracting the nouns and noun phrases from the problem statement. We arrange these classes into a UML class diagram that describes the class structure of our model. The class diagram also describes relationships, known as associations, among classes (for example, a person has an association with the elevator, because the person rides the elevator). Lastly, we extract from the class diagram another type of diagram in the UML the object diagram. The object diagram models the objects (instances of classes) at a specific time in our simulation. Section 4.14 (Optional Case Study) Thinking About Objects: Identifying Class Attributes A class contains both attributes (data) and operations (behaviors). This section focuses on the attributes of the classes discussed in Section 3.7. As we see in later sections, changes in an object s attributes often affect the behavior of that object. To determine the attributes for the classes in our case study, we extract the adjectives describing the nouns and noun phrases (which defined our classes) from the problem statement, then place the attributes in the class diagram we create in Section 3.7. Section 5.11 (Optional Case Study) Thinking About Objects: Identifying Objects States and Activities An object, at any given time, occupies a specific condition called a state. A state transition occurs when that object receives a message to change state. The UML provides the state- chart diagram, which identifies the set of possible states that an object may occupy and models that object s state transitions. An object also has an activity the work performed by an object in its lifetime. The UML provides the activity diagram a flowchart that models an object s activity. In this section, we use both types of diagrams to begin modeling specific behavioral aspects of our elevator simulation, such as how a person rides the elevator and how the elevator responds when a button is pressed on a given floor. Section 6.16 (Optional Case Study) Thinking About Objects: Identifying Class Operations In this section, we identify the operations, or services, of our classes. We extract from the problem statement the verbs and verb phrases that specify the operations for each class. We then modify the class diagram of Fig. 3.16 to include each operation with its associated class. At this point in the case study, we will have gathered all information possible from the problem statement. However, as future chapters introduce such topics as inheritance, event-handling and multithreading, we will modify our classes and diagrams. Section 7.10 (Optional Case Study) Thinking About Objects: Collaboration Among Objects At this point, we have created a rough sketch of the model for our elevator system. In this section, we see how it works. We investigate the behavior of the model by discussing col Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services

Chapter 1 Introduction to Computers, (Cheapest web hosting) the Internet and

Monday, April 23rd, 2007

Chapter 1 Introduction to Computers, the Internet and the Web 41 Appendix C Operator Precedence Chart lists each of the Java operators and indicates their relative precedence and associativity. We list each operator on a separate line and include the full name of the operator. Appendix D ASCII Character Set lists the characters of the ASCII (American Standard Code for Information Interchange) character set and indicates the character code value for each. Java uses the Unicode character set with 16-bit characters for representing all of the characters in the world s commercially significant languages. Unicode includes ASCII as a subset. Currently, most English-speaking countries are using ASCII and just beginning to experiment with Unicode. Appendix E Number Systems discusses the binary (base 2), decimal (base 10), octal (base 8) and hexadecimal (base 16) number systems. This material is valuable for introductory courses in computer science and computer engineering. The appendix is presented with the same pedagogic learning aids as the chapters of the book. A nice feature of the appendix is its 31 exercises, 19 of which are self-review exercises with answers. Appendix F Creating javadoc Documentation introduces the javadoc documentation-generation tool. Sun Microsystems uses javadoc to document the Java APIs. The example in this appendix takes the reader through the javadoc documentation process. First, we introduce the comment style and tags that javadoc recognizes and uses to create documentation. Next, we discuss the commands and options used to run the utility. Finally, we examine the source files javadoc uses and the HTML files javadoc creates. 1.18 (Optional) A Tour of the Case Study on Object-Oriented Design with the UML In this and the next section, we tour the two optional major features of the book the optional case study of object-oriented design with the UML and our introduction to design patterns. The case study involving object-oriented design with the UML is an important addition to Java How to Program, Fourth Edition. This tour previews the contents of the Thinking About Objects sections and discusses how they relate to the case study. After completing this case study, you will have completed an object-oriented design and implementation for a significant Java application. Section 1.15 Thinking About Objects: Introduction to Object Technology and the Unified Modeling Language This section introduces the object-oriented design case study with the UML. We provide a general background of what objects are and how they interact with other objects. We also discuss briefly the state of the software-engineering industry and how the UML has influenced object-oriented analysis and design processes. Section 2.9 (Optional Case Study) Thinking About Objects: Examining the Problem Statement Our case study begins with a problem statement that specifies the requirements for a system that we will create. In this case study, we design and implement a simulation of an elevator system in a two-story building. The application user can create a person on either floor. This person then walks across the floor to the elevator, presses a button, waits for the elevator to arrive and rides it to the other floor. We provide the design of our elevator system after investigating the structure and behavior of object-oriented systems in general. We dis Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services

40 Introduction to Computers, the Internet and the (Web page design)

Monday, April 23rd, 2007

40 Introduction to Computers, the Internet and the Web Chapter 1 Bouncing Ball Physics Demo Knight s Tour Walker Story Teller Craps Morse Code Tic-Tac-Toe Digital Clock MP3 Player Tortoise and the Hare Flight Simulator Multimedia Authoring System Towers of Hanoi Karaoke Pinball Machine Video Conferencing Kinetics Physics Demo Roulette Video Games Appendix A Java Demos presents a huge collection of some of the best Java demos available on the Web. Many of these sites make their source code available to you, so you can download the code and add your own features a truly great way to learn Java! We encourage our students to do this, and we re amazed at the results! You should start your search by checking out the Sun Microsystems applet Web page, java.sun.com/ applets. You can save time finding the best demos by checking out JARS (the Java Applet Rating Service) at www.jars.com. Here s a list of some of the demos mentioned in Appendix A (the URLs and descriptions of each are in Appendix A): Animated SDSU Logo Java Game Park Sevilla RDM 168 Bumpy Lens 3D Java4fun games Stereoscopic 3D Hypercube Centipedo Missile Commando Teamball demos Crazy Counter PhotoAlbum II Tube Famous Curves Applet Index Play A Piano Urbanoids Goldmine Sab s Game Arcade Warp 1.5 Iceblox game SabBowl bowling game Appendix B Java Resources presents some of the best Java resources available on the Web. This is a great way for you to get into the world of Java. The appendix lists various Java resources, such as consortia, journals and companies that make various key Java-related products. Here are some of the resources mentioned in Appendix B: animated applets Intelligence.com newsgroups applets/applications Java Applet Rating Service newsletters arts and entertainment Java Developer Connection Object Management Group audio sites Java Developer s Journal products books Java Media Framework projects Borland JBuilder IDE Java Report publications conferences Java tools puzzles consultants Java Toys reference materials contests Java Users Group (JUGs) resources CORBA homepage Java Woman seminars current information java.sun.com sites databases JavaWorld on-line magazine software demos (many with source code) learning Java Sun Microsystems developer s kit links to Java sites SunWorld on-line magazine development tools lists of resources Team Java discussion groups lists of what is new and cool The Java Tutorial documentation live chat sessions on Java trade shows downloadable applets multimedia collections training (please call us!) FAQs (frequently asked ?s) NASA multimedia gallery tutorials for learning java games NetBeans IDE URLs for Java applets graphics news www.javaworld.com IBM Developers Java Zone news:comp.lang.java Yahoo (Web search engine) Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Chapter 1 Introduction to Computers, (Business web site) the Internet and

Sunday, April 22nd, 2007

Chapter 1 Introduction to Computers, the Internet and the Web 39 beauty of studying these two classes is that they are related through inheritance, as is discussed in Chapter 9, so the java.utilpackage itself implements some classes in terms of others, thus avoiding reinventing the wheel and taking advantage of reuse. We also discuss classes Dictionary, Hashtable, Properties (for creating and manipulating persistent Hashtables), Random and BitSet. The discussion of BitSet includes live code for one of the classic applications of BitSets, namely the Sieve of Eratosthenes, used for determining prime numbers. The chapter discusses in detail Java s powerful bit- manipulation capabilities, which enable programmers to exercise lower level hardware capabilities. This helps programs process bit strings, set individual bits on or off and store information more compactly. Such capabilities inherited from C are characteristic of low-level assembly languages and are valued by programmers writing system software such as operating systems and networking software. Chapter 21 Collections discusses many of the Java 2 classes (of the java.util package) that provide predefined implementations of many of the data structures discussed in Chapter 19. This chapter, too, reinforces the notion of reuse. These classes are modeled after a similar class library in C++ the Standard Template Library. Collections provide Java programmers with a standard set of data structures for storing and retrieving data and a standard set of algorithms (i.e., procedures) that allow programmers to manipulate the data (such as searching for particular data items and sorting data into ascending or descending order). The chapter examples demonstrate collections, such as linked lists, trees, maps and sets, and algorithms for searching, sorting, finding the maximum value, finding the minimum value and so on. Each example clearly shows how powerful and easy to use collections are. The exercises suggest modifications to the chapter examples and ask the reader to reimplement data structures presented in Chapter 19 using collections. Chapter 22 Java Media Framework and Java Sound is the second of our two chapters dedicated to Java s tremendous multimedia capabilities. This chapter focusses on the Java Media Framework (JMF) and the Java Sound API. The Java Media Framework provides both audio and video capabilities. With the JMF, a Java program can play audio and video media and capture audio and video media from devices such as microphones and video cameras. Many of today s multimedia applications involve sending audio or video feeds across the Internet. For example, you can visit the cnn.com Web site to watch or listen to live news conferences, and many people listen to Internet-based radio stations through their Web browsers. The JMF enables Java developers to create so-called streaming media applications, in which a Java program sends live or recorded audio or video feeds across the Internet to other computers, then applications on those other computers play the media as it arrives over the network. The JavaSound APIs enable programs to manipulate Musical Instrument Digital Interface (MIDI) sounds and captured media (i.e., media from a device such as a microphone). This chapter concludes with a substantial MIDI-processing application that enables users to select MIDI files to play and record new MIDI files. Users can create their own MIDI music by interacting with the application s simulated synthesizer keyboard. In addition, the application can synchronize playing the notes in a MIDI file with pressing the keys on the simulated synthesizer keyboard similar to a player piano! As with Chapter 18, once you read this chapter, you will be eager to try all these techniques, so we have included 44 additional multimedia exercises to challenge and entertain you. Some of the interesting projects include the following: Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/8/01
Note: If you are looking for cheap webhost to host and run your apache application check Vision apache web hosting services