Preface

This book is a comprehensive, hands-on guide to Java programming. People who are already familiar with Java or any other programming language will, of course, have an easier time and can move through the initial chapters quickly.

This book will help readers and students to write sophisticated programs that take full advantages of Java's exciting and powerful object-oriented nature. A sincere effort has been made to cover the fundamentals of every technique that a professional needs to master.

This book lays stress on the new ways of thinking needed to master Java programming, so that even experts in more traditional programming languages can benefit from this book. This innovative approach has been followed because trying to force Java into the framework of older programming languages is ultimately self-defeating, and one cannot take advantage of its power if one continues to think within an older paradigm.

Organization of the Book

The subject matter of this book is divided into 24 chapters. Each chapter has been written and developed with a large number of programs which will clear the core concepts of Java. The book has been written specially for those students who are beginners in the field of programming. In this book, one will find numerous programs instead of just code snippets to illustrate even the basic concepts. The book assumes that the reader is new to the concepts of Java programming language, and hence it has been written in a lucid manner. This book also covers some advanced programming examples which might be useful for experienced programmers. The programming examples given in this book have been well tested. Each chapter contains a number of examples that explain the theoretical as well as the practical concepts. Every chapter is followed by questions to test the student performance and receptivity.

Chapter 1 provides an overview of basic introduction to OOPS. It opens with a discussion on structure programming, procedural programming, different programming methodologies, concepts and current trends in the field of object-oriented programming. It briefly introduces the diversity of OOP, and shows how the technology and architectural trends are driving a convergence in the field of OOP. The chapter develops a layered framework for understanding a wide variety of programming concepts and implementations. Viewing the convergence of the field in this framework, the last portion of the chapter lays out the fundamental concepts of object-oriented languages and object-based languages.

Chapter 2 provides an introduction to Java. It describes a set of motivating applications for software development and its applications that are used throughout the rest of the book. It shows what Java programs look like in the virtual machine environment and, hence, what primitives a system must support. It explains the concepts like why Java is a platform-independent language and how to compile and run the Java programs. At the end of this chapter, the concepts of bytecode and JVM are given.

Chapter 3 describes the basic techniques that good Java programmers use to get code-efficient programs to tune the performance out of the underlying architecture. It provides the understanding of operators and expressions used in Java programming. This chapter also covers the detailed description of precedence of operator, techniques used for type conversion, type casting and mathematical functions.

Chapter 4 takes up the challenge of developing the programming, based on the concepts of decision-making statements like if, if-else, nesting of if-else's and switch-case statement. This chapter also addresses the functionality of loops used in Java.

Chapters 5 and 6 provide a complete understanding of the arrays and functions-based program. This chapter covers the detailed description of 1-D, 2-D and 3-D arrays. Also the concept of function, recursion and overloading of function have been discussed.

Chapter 7 talks about classes and objects. The chapter not only includes the description of classes and objects, but also covers constructors, this reference, garbage collection; finalize method and final at the end of the chapter.

Chapter 8 discusses the concepts of inheritance which plays a major role in the field of programming language. This chapter explains the concepts of method overriding, dynamic method dispatch and the way to use super keyword. It also covers the details of object slicing and abstract class.

Chapter 9 introduces the basic concepts of packages (package types) and different methods used for importing packages. This chapter also includes the details of interfaces, mainly interface declaration, implementation, etc.

Chapters 10 and 11 give detailed descriptions of strings, string buffer and exception handling mechanism. It includes the constructor for string class and method of string class. It also includes the basic methodology for exception handling. Chapter 11 also covers different exception classes used in Java. It also gives guidelines to the programmer about exception handling mechanism without using try and catch block, and with the help of try and catch block. The method of creating own exception is given for the programmer/user at the end of Chapter 11.

Chapter 12 introduces threads in Java and describes the key elements of multithreading. A central question addressed in the chapter is how to create thread and implements. Thread priority, synchronization, communication, suspending and resuming of threads are covered in this chapter. This chapter also includes the concept of daemon thread.

Chapter 13 surveys a wide variety of concepts used with files in Java. This chapter deals with the concepts of different streams used in file handling. This chapter also handles operations like reading from console, writing to console, etc.

Chapter 14 introduces the set of core ideas that are used for Applet and Graphics programming. This chapter covers the life cycle and application areas of applets. This chapter also covers the motivational and widespread application areas of Graphic class.

Chapter 15 covers the detailed description of event handling methodology in Java. This chapter also includes the Delegation event model, Event Listeners, Event Sources. At the end of this chapter, Adapter classes, nested and inner classes have been covered.

Chapters 16 and 17 describe a representative sample for how to work with Abstract Windows Toolkit and the basic structure of AWT. Chapter 16 also covers the details of AWT windows hierarchy, container class and component class. Chapter 17 puts the main focus on the concepts of layouts like Flow Layout, Border Layout, Card Layout, etc. used in Java programming.

Chapters 18 and 19 consider the description of Collection Framework used in Java. Chapter 18 basically covers the description of Collection classes, Array list, Hash set, TreeSet, Maps and Maps classes. Chapter 19 discusses the utility classes like Date, Calendar, Random, System and Runtime used in Java.

Chapter 20 puts the focus on the basic networking supported by Java. This chapter is dedicated to Java.net package, Socket programming and Internet addressing using Java.

Chapter 21 gives a detailed description of the advanced topics like JNI, serialization and RMI. Basically, this chapter is devoted to the description of JNI and how to use the concepts of JNI. It also gives the description of classes and interfaces for serialization.

Chapters 22 and 23 describe the working of images and swing. Chapter 22 basically covers the concepts of ImageObserver interface, double buffering and producing and consuming image data. Chapter 23 includes the details of the following—JApplet class, ImageIcon class, JLabel class, JComboBox, class, Dialogs and JTable class.

Chapter 24 explains the concepts of virtual machine and hierarchy of virtual machine. It also covers the detailed description of API programming, different packages and classes used for API programming.

Appendix 1 covers the description of the Java keywords.

Appendix 2 describes how to create Java executable file.

Appendix 3 covers the JAR tools with the details about the command and different options.

Sample Project is given for the students to understand the usability of Java.

My original goal was to make this book a 'one-stop resource' but, realistically, Java programming has gotten far too big and far too powerful to be covered in a single book. Nonetheless, if you finish this book, I truly believe that you will be in a position to begin writing commercial-quality Java programs.

All efforts have been made to make this book error free. However, there is possibility that some errors have crept in inadvertently. I would, therefore, be grateful if such oversights are pointed out by the readers and would also be happy to acknowledge suggestions for further improvement of this book.

HARI MOHAN PANDEY

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.210.205