Introduction to Java Programming

Paperback
from $0.00

Author: Y. Daniel Liang

ISBN-10: 0132130807

ISBN-13: 9780132130806

Category: Network Programming

CourseSmart\ Save money. Lighten your backpack. Access your textbooks anytime, from anywhere.\ This title is available as an eTextbook from CourseSmart. Purchase your assigned textbook as a CourseSmart eTextbook, and stop lugging books around campus! You can also access CourseSmart eTextbooks from your iPhone.\ Instructors, request your exam copies online and get instant access. Learn more at coursesmart.com.

Search in google:

Introduction to Java Programming, Comprehensive, 8e, features comprehensive coverage ideal for a one-, two-, or three-semester CS1 course sequence.Regardless of major, students will be able to grasp concepts of problem-solving and programming — thanks to Liang’s fundamentals-first approach, students learn critical problem solving skills and core constructs before object-oriented programming. Liang’s approach has been extended to application-rich programming examples, which go beyond the traditional math-based problems found in most texts. Students are introduced to topics like control statements, methods, and arrays before learning to create classes. Later chapters introduce advanced topics including graphical user interface, exception handling, I/O, and data structures. Small, simple examples demonstrate concepts and techniques while longer examples are presented in case studies with overall discussions and thorough line-by-line explanations. Increased data structures chapters make the Eighth Edition ideal for a full course on data structures.

PREFACE: \ PREFACE\ To the Instructor\ There are three popular strategies in teaching Java. The first is to mix Java applets and graphics programming with object-oriented programming concepts. The second is to introduce object-oriented programming from the start. The third strategy is a step-by-step approach, first laying a sound foundation on programming concepts, control statements, and methods, then introducing object-oriented programming, and finally moving on to graphical user interface (GUI), applets, internationalization, multithreading, multimedia, I/O, and networking.\ The first strategy, starting with GUI and applets, seems attractive, but requires substantial knowledge of object-oriented programming and a good understanding of the Java event-handling model; thus, students may never fully understand what they are doing. The second strategy is based on the notion that the objects should be introduced first because Java is an object-oriented programming language. This notion, however, does not strike a chord with students. From the more than 40 Java courses I have taught, I have concluded that introducing primary data types, control structures, and methods prepares students to learn object-oriented programming. Therefore, this text adopts the third strategy, first proceeding at a steady pace through all the necessary and important basic concepts, then moving to object-oriented programming, and then to using the object-oriented approach to build interesting GUI applications and applets with multithreading, multimedia, I/O, and networking.\ The book is suited for both beginning and advanced students, depending on how it is used. Thisbook has been used in a two-semester freshman programming course and a one-semester course in Java as a second language. It has also been used for a short training course for experienced programmers. Computer science departments, engineering departments, and management information systems departments around the world have used this book at various levels. For students with no programming experience, the emphasis should be on Part I of the book, particularly on writing the loops. You could spend the entire semester of four credit hours just on the first six chapters of the book.\ The Instructor's Manual on CD-ROM is available for instructors using this book. It contains the following resources:\ \ Microsoft PowerPoint slides for lectures.\ Answers to review questions.\ Source code for the examples in the book.\ The new edition provides 45% more programming exercises. Instructor's Solutions are provided in the Instructor's Manual. Students will have access to the solutions of even-numbered exercises.\ Over 450 multiple-choice and true-or-false questions and answers covering all of the chapters of the book in sequence. These questions can be used in the exams or as additional review questions.\ \ To obtain the Instructor's Manual, contact your Prentice-Hall sales representative.\ Microsoft PowerPoint slides, answers to review questions, solutions to even-numbered programming exercises, and source code for the examples in the book are also available at the book's companion Web site at www.cs.armstrong.edu/liang/intro3e.html and www.prenhall.com/liang\ Pedagogical Features of the Book\ Introduction to Java Programming Third Edition uses the following elements to get the most out of the material:\ \ Objectives lists what students should have learned from the chapter. This will help them to determine whether they have met the objectives after completing the chapter.\ Introduction opens the discussion with a-brief overview of what to expect from the chapter.\ Programming concepts are taught by representative Examples, carefully chosen and presented in an easy-to-follow style. Each example is described, and includes the source code, a sample run, and an example review. The source code of the examples is contained in the companion CD-ROM.\ Each program is complete and ready to be compiled and executed. The sample run of the program is captured from the screen to give students a live presentation of the example. Reading these examples is much like entering and running them on a computer.\ Chapter Summary reviews the important subjects that students should understand and remember. It helps them to reinforce the key concepts they have learned in the chapter.\ Review Questions help students to track their progress and evaluate their learning.\ Programming Exercises at the end of each chapter provide students with opportunities to apply the skills on their own. The trick of learning programming is practice, practice, and practice. To that end, the book provides a large number of exercises.\ Notes and Tips are inserted throughout the text to offer valuable advice and insight on important aspects of program development.\ – NOTE: Provides additional information on the subject and reinforces important concepts.\ – TIP: Teaches good programming style and practice, and helps students steer away from the pitfalls of programming errors.\ \ What's New in This Edition\ This book expands and improves upon the second edition of Introduction to Java Programming. The major changes are as follows:\ \ The use of UML enhances the treatment of object-oriented design and programming. UML graphical notations are used to describe classes and their relationships throughout the book.\ Beginning with Chapter 8, "Getting Started with Graphics Programming," all the AWT user interface components are replaced with state-of-the-art Swing components.\ Chapter 12, "Internationalization," is brand-new. It introduces date, time, and number formatting, and the development of Java programs for international audiences.\ Several new case studies are provided to give more examples for learning the fundamentals of programming, such as writing loops.\ Nonessential sections are marked optional and can be skipped or covered later with no adverse effect on the students' understanding of subsequent chapters. These sections include such topics as recursion, advanced layout managers, and resource bundles.\ Several new appendices provide readers with additional background information.\ \ To the Student\ There is nothing more important to the future of computing than the Internet. There is nothing more exciting on the Internet than Java. A revolutionary programming language developed by Sun Microsystems, Java has become the de facto standard for cross-platform applications and programming on the World Wide Web.\ Before Java, the Web was used primarily for viewing static information on the Internet using HTML, a marked-up language for document layout and for linking documents over the Internet. Java programs can be embedded in an HTML page and downloaded by Web browsers to bring live animation and interactive applications to Web clients.\ Java is a full-featured, general-purpose programming language that is capable of developing robust mission-critical applications. In the last three years, Java has gained enormous popularity and has quickly become the most popular and successful programming language. Today, it is used not only for Web programming, but also for developing standalone applications. Many companies that once considered Java to be more hype than substance are now using it to create distributed applications accessed by customers and partners across the Internet. For every new project being developed today, companies are asking how they can use Java to make their work easier.\ Java's Design and Advantages\ Java is an object-oriented programming language. Object-oriented programming is a favored programming approach that has replaced traditional procedure-based programming techniques. An object-oriented language uses abstraction, encapsulation, inheritance, and polymorphism to provide great flexibility, modularity, and reusability for developing software.\ Java is platform-independent. Its programs can run on any platform with a Java Virtual Machine, a software component that interprets Java instructions and carries out associated actions.\ Java is distributed. Networking is inherently built-in. Simultaneous processing can occur on multiple computers on the Internet. Writing network programs is treated as simple data input and output.\ Java is multithreaded. Multithreading is the capability of a program to perform several tasks simultaneously, such as downloading a video file while playing the video at the same time. Multithreading is particularly useful in graphical user interfaces (GUI) and network programming. Multithread programming is smoothly integrated in Java. In other languages, you can only enable multithreading by calling procedures that are specific to the operating system.\ Java is secure. Computers become vulnerable when they are connected with other computers. Viruses and malicious programs can damage your computer. Java is designed with multiple layers of security that ensure proper access to private data and restrict access to disk files.\ Java's Versatility\ Stimulated by the promise of writing programs once and running them anywhere, Java has become the most important programming language. IBM, Sun, and Apple, and many other vendors are working to integrate the Java Virtual Machine with their operating systems so that Java programs can run directly and efficiently on the native machine. Java programs run on full-featured computers, and also on consumer electronics and appliances.\ Because of its great potential to unite existing legacy applications written on different platforms so that they can run together, Java has been perceived as a universal front end for the enterprise database. The leading database companies, IBM, Oracle, Sybase, and Informix, have extended their commitment to Java by integrating it into their products. Oracle, for example, enables Java applications to run on its server, and to deliver a complete set of Java-based development tools supporting the integration of current applications with the Web.\ Learning Java\ To the first time programmers, learning Java is like learning any high-level programming languages. The fundamentals of learning programming is to develop critical skills of formulating programmatic solutions for the programs and to translate the solutions into programs using the selection statements, loops, and methods.\ Applying the concept of abstraction in the design and implementation of software projects is the key to developing software. The overriding objective of this book, therefore, is to teach students to use many levels of abstraction in solving problems and to see problems in small and in large.\ Students with no programming experience should take a slow-pace approach in Part I of the book. I recommend you to complete all the exercises in Chapter 3 and 4 before moving to Chapter 5. Students new to object-oriented programming may need some time to become familiar with the concept of objects and classes. Once the principles are mastered, programming in Java is easy and productive. Students who know object-oriented programming languages like C++ and Smalltalk will find it easier to learn Java. In fact, they will find that Java is simpler than C++ and Smalltalk in many aspects.\ Organization of the Book\ This book is divided into four parts that, taken together, form a comprehensive introductory course on Java programming. Because knowledge is cumulative, the early chapters provide the conceptual basis for understanding Java and guide students through simple examples and exercises; subsequent chapters progressively present Java programming in detail, culminating with the development of comprehensive Java applications. The appendixes contain a mixed bag of topics, including an HTML tutorial.\ Part I: Fundamentals of Programming\ The first part of the book is a stepping stone that will prepare you to embark on the journey of learning Java. You will begin to know Java, and will learn how to write simple Java programs with primitive data types, control statements, and methods.\ Chapter 1, "Introduction to Java," gives an overview of the major features of Java: object-oriented programming, platform-independence, Java bytecode, security, performance, multithreading, and networking. The chapter also introduces how to create, compile, and run Java applications and applets. Simple examples of writing applications and applets are provided, along with a brief anatomy of programming structures.\ Chapter 2, "Primitive Data Types and Operations," introduces primitive data types, operators, and expressions. Important topics include identifiers, variables, constants, assignment statements, primitive data types, operators, and shortcut operators. Java programming style and documentation are also addressed.\ Chapter 3, "Control Statements," introduces decision and repetition statements. Java decision statements include various forms of if statements, and the switch statement. Java repetition statements include the while loop, the do loop, and the for loop. The keywords break and continue are discussed.\ Chapter 4, "Methods," introduces method creation, calling methods, passing parameters, returning values, method overloading, and recursion. Applying the concept of abstraction is the key to developing software. The chapter also introduces the use of method abstraction in problem-solving. The math class for performing basic math operations is introduced.\ Part II: Object-Oriented Programming\ In the book's second part, object-oriented programming is introduced. Java is a class-centric, object-oriented programming language that uses abstraction, encapsulation, inheritance, and polymorphism to provide great flexibility, modularity, and reusability in developing software. You will learn programming with objects and classes, arrays and strings, and class inheritance.\ Chapter 5, "Programming with Objects and Classes," begins with objects and classes. The important topics include defining classes, creating objects, using constructors, passing objects to methods, instance and class variables, and instance and class methods, analyzing relationships among classes, and using the UML graphical notations to describe classes. Several examples are provided to demonstrate the power of the object-oriented programming approach. Students will learn the benefits (abstraction, encapsulation, and modularity) of object-oriented programming from these examples. There are more than 500 predefined Java classes grouped in several packages. Starting with this chapter, students will gradually learn how to use Java classes to develop their own programs. The classes string, stringBuffer, and stringTokenizer for storing and processing strings are introduced.\ Chapter 6, "Class Inheritance," teaches how an existing class can be extended and modified as needed. Inheritance is an extremely powerful programming technique, further extending software reusability. Java programs are all built by extending predefined Java classes. The major topics include defining subclasses, using the keywords super and this, using the modifiers protected, final and abstract, polymorphism and dynamic binding, and casting objects. This chapter introduces the object class, which is the root of all Java classes. You will learn to use abstract classes, and interfaces.\ Chapter 7, "Arrays and Vectors," explores an important structure: arrays for processing data in lists and tables. You will learn how to declare, initialize, and copy arrays. You will also learn how to use wrapper classes to encapsulate primitive data type values in objects for use in generic programming. This chapter introduces the vector class, which can be used to store an unspecified number of elements.\ Part III: Graphics Programming\ The third part of the book introduces Java graphics programming. Major topics include event-driven programming, creating graphical user interfaces, and writing applets. You will learn the architecture of Java graphics programming API and use the user interface components to develop graphics applications and applets.\ Chapter 8, "Getting Started with Graphics Programming," introduces the concepts of Java graphics programming using Swing components. Topics include the Swing class hierarchy, event-driven programming, frames, panels, and simple layout managers (F1owLayout, GridLayout, and BorderLayout). The chapter also introduces drawing geometric figures in the graphics context.\ Chapter 9, "Creating User Interfaces," introduces the user interface components: buttons, labels, text fields, text areas, combo boxes, lists, check boxes, radio buttons, menus, scrollbars, and scroll panes. Today's client/server and Web-based applications use a graphical user interface (GUI, pronounced "goo-ee"). Java has a rich set of classes to help you build GUIs.\ Chapter 10, "Applets and Advanced Graphics," takes an in-depth look at applets, discussing applet behavior and the relationship between applets and other Swing classes. Applets are a special kind of Java class that can be executed from the Web browser. Students will learn how to convert applications to applets, and vice versa, and how to run programs both as applications and as applets. The chapter also introduces two advanced layout mangers (cardLayout and GridBagLayout) and the use of no layout. Advanced examples of handling mouse and keyboard events are provided. You will learn how to package and deploy Java applications and applets.\ Part IV: Developing Comprehensive Projects\ The book's final part is devoted to several advanced features of Java programming. You will learn how to use these features to develop comprehensive programs; for example, using exception handling to make your program robust, using multithreading to make your program more responsive and interactive, incorporating sound and images to make your program user-friendly, using input and output to manage and process a large quantity of data, and creating client/server applications with Java networking support.\ Chapter 11, "Exception Handling," teaches students how to define exceptions, throw exceptions, and handle exceptions so that their programs can either continue to run or terminate gracefully in the event of runtime errors. The chapter discusses predefined exception classes, and gives examples of creating user-defined exception classes.\ Chapter 12, "Internationalization," introduces the development of Java programs for international audiences. You will learn how to format dates, numbers, currencies, and percentages for different regions, countries, and languages. You will also learn how to use resource bundles to define which images and strings are used by a component depending on the user's locale and preferences.\ Chapter 13, "Multithreading," introduces threads, which enable the running of multiple tasks simultaneously in one program. Students will learn how to use the Thread class and the Runnable interface to launch separate threads. The chapter also discusses thread states, thread priority, thread groups, and the synchronization of conflicting threads.\ Chapter 14, "Multimedia," teaches how to incorporate sound and images to bring live animation to Java programs. Various techniques for smoothing animation are introduced.\ Chapter 15, "Input and Output," introduces input and output streams. Students will learn the class structures of I/O streams, byte and character streams, file I/O streams, data I/O streams, print streams, delimited I/O, random file access, and interactive I/O.\ Chapter 16, "Networking," introduces network programming. Students will learn the concept of network communication, stream sockets, client/server programming, and reading data files from the Web server.\ Appendixes\ This part of the book covers a mixed bag of topics. Appendix A lists Java keywords. Appendix B gives tables of ASCII characters and their associated codes in decimal and in hex. Appendix C shows the operator precedence. Appendix D summarizes Java modifiers and their usage. Appendix E introduces number systems and conversions among binary, decimal, and hex numbers. Appendix F introduces HTML basics. Appendix G lists UML Graphical Notations for describing classes and their relationships. Appendix H introduces packages for grouping classes. Appendix I gives a JBuilder 3.5 tutorial. Finally, Appendix J provides a glossary of key terms used in the text.

NOTE: this is a comprehensive version. For a brief text, please visit "Introduction to Java Programming, Brief Edition"Chapter 1 Introduction to Computers, Programs, and JavaChapter 2 Elementary ProgrammingChapter 3 SelectionsChapter 4 LoopsChapter 5 MethodsChapter 6 ArraysChapter 7 Objects and ClassesChapter 8 Strings and Text I/OChapter 9 Thinking in ObjectsChapter 10 Inheritance and PolymorphismChapter 11 Abstract Classes and InterfacesChapter 12 Object-Oriented Design and PatternsChapter 13 GUI BasicsChapter 14 GraphicsChapter 15 Event-Driven ProgrammingChapter 16 Creating User InterfacesChapter 17 Applets and MultimediaChapter 18 Exception HandlingChapter 19 Binary I/OChapter 20 RecursionChapter 21 GenericsChapter 22 Java Collections FrameworkChapter 23 Algorithm EfficiencyChapter 24 Lists, Stacks, and QueuesChapter 25 Trees, Heaps, and Priority QueuesChapter 26 SortingChapter 27 Graph ApplicationsChapter 28 Weighted Graph ApplicationsChapter 29 MultithreadingChapter 30 NetworkingChapter 31 InternationalizationChapter 32 JavaBeans and Bean EventsChapter 33 Containers, Layout Managers, and BordersChapter 34 Menus, Toolbars, and DialogsChapter 35 MVC and Swing ModelsChapter 36 JTable and JTreeChapter 37 Java Database ProgrammingChapter 38 Advanced Java Database ProgrammingChapter 39 Servlets Chapter 40 JavaServer PagesChapter 41 JSF and Visual Web DevelopmentChapter 42 Web ServicesChapter 43 Remote Method Invocation***Note that Chapters 38-43 are bonus chapters in the companying CD-ROMAppendixesAppendix A Java KeywordsAppendix B The ASCII Character SetAppendix C Operator Precedence ChartAppendix D Java ModifiersAppendix E Special Floating-Point ValuesAppendix F Correlation between the 7E and 6E

\ From the Publisher“All the topics and concepts are clearly explained with examples and tips to remember with side texts.” — Syed Riaz Ahmed, North Georgia College and State University\ “The first, best feature of this text is the rich set of clear example code provided — which are located in concise textual explanations well-suited for the modern undergraduate. In addition, the wide coverage of material makes this book suitable for several courses. For an undergraduate student, it is a true “keeper”.” — Frank Ducrest, University of Louisiana — Lafayette\ “One book [Liang] for ALL Java courses.” — Maureen Opkins, California State University — Long Beach\ “The thorough nature of this text [Liang] should be stressed; it has utility as a reference far after the course is over.” — Dale Parson, Kutztown University of Pennsylvania\ “The interactive and animated online support for this text [Liang] will help students realize how Java syntax evolves into a Java program, which, in turn, executes.” — Barbara Guillott, Louisiana State University\ \ \