Michigan web site - 18 Part I: Getting Started that features of

18 Part I: Getting Started that features of C++ and threw them in the trash. Then he added features that made the development of objects smoother and easier. All in all, Gosling created a language whose object-oriented philosophy is pure and clean. When you program in Java, you have no choice but to work with objects. That s the way it should be. (continued) Now notice that I put the word classes first. How dare I do this! Well, maybe I m not so crazy. Think again about a housing development that s under construction. Somewhere on the lot, in a rickety trailer parked on bare dirt, is a master list of characteristics known as a blueprint. An architect s blueprint is like an object-oriented programmer s class. A blueprint is a list of characteristics that each house will have. The blueprint says, siding. The actual house object has gray siding. The blueprint says, kitchen cabinet. The actual house object has Louis XIV kitchen cabinets. The analogy doesn t end with lists of characteristics. Another important parallel exists between blueprints and classes. A year after you create the blueprint, you use it to build ten houses. It s the same with classes and objects. First, the programmer writes code to describe a class. Then when the program runs, the computer creates objects from the (blueprint) class. So that s the real relationship between classes and objects. The programmer defines a class, and from the class definition, the computer makes individual objects. What s so good about an object-oriented language? Based on the previous section s story about home building, imagine that you have already written a computer program to keep track of the building instructions for houses in a new development. Then, the big boss decides on a modified plan a plan in which half the houses have three bedrooms, and the other half have four. If you use the old FORTRAN/C style of computer programming, your instructions look like this: Dig a ditch for the basement. Lay concrete around the sides of the ditch. Put two-by-fours along the sides for the basement s frame. … This would be like an architect creating a long list of instructions instead of a blueprint. To modify the plan, you have to sort through the list to find the
We will hook you up with a JSP web hosting at the great rate, check our jsp web hosting, and join us today!!!

Leave a Reply