Programming in Java - Sachin Malhotra, Saurabh Chaudhary

Programming in Java

Buch | Softcover
680 Seiten
2014 | 2nd Revised edition
OUP India (Verlag)
978-0-19-809485-2 (ISBN)
22,40 inkl. MwSt
  • Titel ist leider vergriffen;
    keine Neuauflage
  • Artikel merken
Programming in Java 2e is primarily designed for the students of computer science and information technology as well as MCA. Thoroughly updated for Java Standard Edition 7 (Java SE 7), this revised edition provides greater topical coverage and more programming examples in every chapter.
The second edition of Programming in Java confirms to Java Standard Edition 7, the latest release since Oracle took over Sun Microsystems. It is significant in the sense that the last update was six years back and this major release comes bundled with plenty of enhancements which were overdue. To list a few noticeable enhancements, Java 7 includes support for strings in switch statements, try-with-resources statement, improved multi-catch, binary numeric literals, numeric literals with
underscores, new APIs in NIO like Path and Files, automatic resource management, and much more. The second edition presents all these new topics with suitable examples.

This second edition is not just about the enhancements introduced in Java 7; practically every chapter has been revisited to refine the text as much as possible with new example codes and greater topical coverage.

Sachin Malhotra is currently Associate Professor in the IT department of IMS Ghaziabad. He has more than a decade long experience in mentoring students on developing Java applications as well as training practising professionals in the field of Java. He has also designed and conducted various corporate trainings in Java and networking. Saurabh Choudhary is currently a practising IT consultant and corporate trainer. He has more than 12 years of experience in industry, academia, and consultancy. His areas of expertise include Java, Database Management System, and Information Systems.

1. INTRODUCTION TO OOP ; 1.1 Introduction ; 1.2 Need of Object-Oriented Programming ; 1.2.1 Procedural Languages ; 1.2.2 Object-Oriented Modeling ; 1.3 Principles of Object-Oriented Languages ; 1.3.1 Classes ; 1.3.2 Objects ; 1.3.3 Abstraction ; 1.3.4 Inheritance ; 1.3.5 Encapsulation ; 1.3.6 Polymorphism ; 1.4 Procedural Language vs OOP ; 1.5 OOAD Using UML ; 1.6 Applications of OOP ; 2. GETTING STARTED WITH JAVA ; 2.1 Introduction ; 2.2 History of Java ; 2.3 Java's Journey: From Embedded Systems To Middle-Tier Applications ; 2.4 Java Essentials ; 2.5 Java Virtual Machine ; 2.6 Java Features ; 2.6.1 Platform Independence ; 2.6.2 Object Oriented ; 2.6.3 Both Compiled and Interpreted ; 2.6.4 Java is Robust ; 2.6.5 Java Language Security Features ; 2.6.6 Java is Multithreaded ; 2.6.7 Other Features ; 2.7 Program Structure ; 2.7.1 How to Execute a Java Program ; 2.7.2 Why Save as Example.Java? ; 2.7.3 Explanation ; 2.8 Java Improvements ; 2.8.1 Java 5.0 Features ; 2.8.2 Java 6 Features ; 2.8.3 Java 7 Features ; 2.8.4 Brief Comparison of Different Releases ; 2.9 Differences between Java and C++ ; 2.10 Installation of JDK 1.7 ; 2.10.1 Getting Started With the JDK ; 2.10.2 JDK Installation Notes ; 2.10.3 Exploring the JDK ; 2.11 Integrated Development Environment ; 3. JAVA PROGRAMMING CONSTRUCTS ; 3.1 Variables ; 3.2 Primitive Data Types ; 3.3 Identi?er ; 3.3.1 Rules for Naming ; 3.3.2 Naming Convention ; 3.3.3 Keywords ; 3.4 Literals ; 3.5 Operators ; 3.5.1 Binary Operators ; 3.5.2 Unary Operators ; 3.5.3 Ternary Operator ; 3.6 Expressions ; 3.7 Precedence Rules and Associativity ; 3.8 Primitive Type Conversion and Casting ; 3.9 Flow of Control ; 3.9.1 Conditional Statements ; 3.9.2 Loops ; 3.9.3 Branching Mechanism ; 4. CLASSES AND OBJECTS ; 4.1 Classes ; 4.2 Objects ; 4.2.1 Difference between Objects and Classes ; 4.2.2 Why Should We Use Objects and Classes? ; 4.3 Class Declaration in Java ; 4.3.1 Class Body ; 4.4 Creating Objects ; 4.4.1 Declaring an Object ; 4.4.2 Instantiating an Object ; 4.4.3 Initializing an Object ; 4.5 Methods ; 4.5.1 Why Use Methods? ; 4.5.2 Method Types ; 4.5.3 Method Declaration ; 4.5.4 Instance Method Invocation ; 4.5.5 Method Overloading ; 4.6 Constructors ; 4.6.1 Parameterized Constructors ; 4.6.2 Constructor Overloading ; 4.7 Cleaning Up Unused Objects ; 4.7.1 The Garbage Collector ; 4.7.2 Finalization ; 4.7.3 Advantages and Disadvantages ; 4.8 Class Variable and Methods-Static Keyword ; 4.8.1 Static Variables ; 4.8.2 Static Methods ; 4.8.3 Static Initialization Block ; 4.9 this Keyword ; 4.10 Arrays ; 4.10.1 One-Dimensional Arrays ; 4.10.2 Two-Dimensional Arrays ; 4.10.3 Using for-each with Arrays ; 4.10.4 Passing Arrays to Methods ; 4.10.5 Returning Arrays from Methods ; 4.10.6 Variable Arguments ; 4.11 Command-line Arguments ; 4.12 Nested Classes ; 4.12.1 Inner Class ; 4.12.2 Static Nested Class ; 4.12.3 Why Do We Create Nested Classes? ; 4.13 Practical Problem: Complex Number Program ; 5. INHERITANCE ; 5.1 Inheritance vs Aggregation ; 5.1.1 Types of Inheritance ; 5.1.2 Deriving Classes Using Extends Keyword ; 5.2 Method Overriding ; 5.3 super Keyword ; 5.4 ?nal Keyword ; 5.5 Abstract Class ; 5.6 Shadowing vs Overriding ; 5.7 Practical Problem: Circle and Cylinder Class ; 6. INTERFACES, PACKAGES, AND ENUMERATION ; 6.1 Interfaces ; 6.1.1 Variables in Interface ; 6.1.2 Extending Interfaces ; 6.1.3 Interface vs Abstract Classes ; 6.2 Packages ; 6.2.1 Creating Packages ; 6.2.2 Using Packages ; 6.2.3 Access Protection ; 6.3 java.lang Package ; 6.3.1 java.lang.Object Class ; 6.3.2 Java Wrapper Classes ; 6.3.3 String Class ; 6.3.4 StringBuffer Class ; 6.3.5 StringBuilder Class ; 6.3.6 Splitting Strings ; 6.4 Enum Type ; 6.4.1 Using Conditional Statements with an Enumerated Variable ; 6.4.2 Using for Loop for Accessing Values ; 6.4.3 Attributes and Methods within Enumeration ; 6.5 Practical Problem : Banking Example ; 7. EXCEPTION, ASSERTIONS, AND LOGGING ; 7.1 Introduction ; 7.1.1 Exception Types ; 7.2 Exception Handling Techniques ; 7.2.1 trycatch ; 7.2.2 throw Keyword ; 7.2.3 throws ; 7.2.4 finally Block ; 7.2.5 try-with-resources Statement ; 7.2.6 Multi Catch ; 7.2.7 Improved Exception Handling in Java 7 ; 7.3 User-Defined Exception ; 7.4 Exception Encapsulation and Enrichment ; 7.5 Assertions ; 7.6 Logging ; 8. MULTITHREADING IN JAVA ; 8.1 Introduction ; 8.2 Multithreading in Java ; 8.3 java.lang.Thread ; 8.4 Main Thread ; 8.5 Creation of New Threads ; 8.5.1 By Inheriting the Thread Class ; 8.5.2 Implementing the Runnable Interface ; 8.6 Thread.State in Java ; 8.6.1 Thread States ; 8.7 Thread Priority ; 8.8 Multithreading-Using isAlive() and join() ; 8.9 Synchronization ; 8.9.1 Synchronized Methods ; 8.9.2 Synchronized Statements ; 8.10 Suspending and Resuming Threads ; 8.11 Communication between Threads ; 8.12 Practical Problem: TimeClock Example ; 9. INPUT/OUTPUT, SERIALIZATION AND CLONING ; 9.1 Introduction ; 9.1.1 java.io.InputStream andjava io.OutputStream ; 9.2 java.io.File Class ; 9.3 Reading and Writing Data ; 9.3.1 Reading/Writing Files Using Byte Stream ; 9.3.2 Reading/Writing Console(User Input) ; 9.3.3 Reading/Writing Files Using Character Stream ; 9.3.4 Reading/Writing Using Buffered Byte Stream Classes ; 9.3.5 Reading/Writing Using Buffered Character Stream Classes ; 9.4 Randomly Accessing a File ; 9.5 Reading and Writing Files Using New I/O Package ; 9.6 Java 7 Nio Enhancements ; 9.7 Serialization ; 9.8 Cloning ; 10. GENERICS, JAVA.UTIL AND OTHER API ; 10.1 Introduction ; 10.2 Generics ; 10.2.1 Using Generics in Arguments and Return Types ; 10.2.2 Wildcards ; 10.2.3 Bounded Wildcards ; 10.2.4 De?ning Your Own Generic Classes ; 10.3 Linked List ; 10.4 Set ; 10.4.1 Hashset Class ; 10.4.2 Treeset Class ; 10.5 Maps ; 10.5.1 Hashmap Class ; 10.5.2 Treemap Class ; 10.6 Collections ; 10.7 Legacy Classes and Interfaces ; 10.7.1 Difference between Vector and Arraylist ; 10.7.2 Difference between Enumerations and Iterator ; 10.8 Utility Classes: Random Class ; 10.8.1 Observer and Observable ; 10.9 Runtime Class ; 10.10 Re? ection API ; 11. NETWORK PROGRAMMING ; 11.1 Introduction ; 11.1.1 TCP/IP Protocol Suite ; 11.2 Sockets ; 11.2.1 TCP Client and Server ; 11.2.2 UDP Client and Server ; 11.3 URL Class ; 11.4 Multithreaded Sockets ; 11.5 Network Interface ; 12. APPLETS ; 12.1 Introduction ; 12.2 Applet Class ; 12.3 Applet Structure ; 12.4 Example Applet Program ; 12.4.1 How to Run an Applet? ; 12.5 Applet Life Cycle ; 12.6 Common Methods Used in Displaying the Output ; 12.7 paint(), update(), and repaint() ; 12.7.1 paint() Method ; 12.7.2 update() Method ; 12.7.3 repaint() Method ; 12.8 More About Applet Tag ; 12.9 getDocumentbase() and getCodebase() Methods ; 12.10 Appletcontext Interface ; 12.10.1 Communication between Two Applets ; 12.11 How To Use An Audio Clip? ; 12.12 Images in Applet ; 12.12.1 Mediatracker Class ; 12.13 Graphics Class ; 12.13.1 An Example Applet Using Graphics ; 12.14 Color ; 12.15 Font ; 12.16 Fontmetrics ; 12.17 Practical Problem: Digital Clock ; 13. EVENT HANDLING IN JAVA ; 13.1 Introduction ; 13.2 Event Delegation Model ; 13.3 java.awt.Event Description ; 13.3.1 Event Classes ; 13.4 Sources of Events ; 13.5 Event Listeners ; 13.6 How Does The Model Work? ; 13.7 Adapter Classes ; 13.7.1 How To Use Adapter Classes 410 13.7.2 Adapter Classes in Java ; 13.8 Inner Classes in Event Handling ; 13.9 Practical Problem: Cartoon Applet ; 13.9.1 Smiling Cartoon With Blinking Eyes (Part 1) ; 13.9.2 Smiling Cartoon With Blinking Eyes (Part 2) ; 13.9.3 Smiling Cartoon (Part 3) ; 14. ABSTRACT WINDOW TOOLKIT ; 14.1 Introduction ; 14.1.1 Why Awt? ; 14.1.2 java.awt Package ; 14.2 Components and Containers ; 14.2.1 Component ; 14.2.2 Components as Event Generator ; 14.3 Button ; 14.4 Label ; 14.5 Checkbox ; 14.6 Radio Buttons ; 14.7 List Boxes ; 14.8 Choice Boxes ; 14.9 Text?eld and Textarea ; 14.10 Container Class ; 14.10.1 Panels ; 14.10.2 Window ; 14.10.3 Frame ; 14.11 Layouts ; 14.11.1 FlowLayout ; 14.11.2 BorderLayout ; 14.11.3 CardLayout ; 14.11.4 GridLayout ; 14.11.5 GridbagLayout ; 14.12 Menu ; 14.13 Scrollbar ; 14.14 Practical Problem: City Map Applet ; 15. SWING ; 15.1 Introduction ; 15.1.1 Features of Swing ; 15.1.2 Differences between Swing and AWT ; 15.2 JFrame ; 15.3 JApplet ; 15.4 JPanel ; 15.5 Components in Swings ; 15.6 Layout Managers ; 15.6.1 Springlayout ; 15.6.2 Boxlayout ; 15.7 JList and JScrollPane ; 15.8 Split Pane ; 15.9 JTabbedPane ; 15.10 JTree ; 15.11 JTable ; 15.12 Dialog Box ; 15.13 JFileChooser ; 15.14 JColorChooser ; 15.15 Pluggable Look and Feel ; 15.16 Inner Frames ; 15.17 Practical Problem: Mini Editor ; 16. INTRODUCTION TO ADVANCED JAVA ; 16.1 Introduction to J2EE ; 16.2 Database Handling Using JDBC ; 16.2.1 Load the Driver ; 16.2.2 Establish Connection ; 16.2.3 Create Statement ; 16.2.4 Execute Query ; 16.2.5 Iterate Resultset ; 16.2.6 Scrollable Resultset ; 16.2.7 Transactions ; 16.3 Servlets ; 16.3.1 Lifecycle of Servlets ; 16.3.2 First Servlet ; 16.3.3 Reading Client Data ; 16.3.4 Http Redirects ; 16.3.5 Cookies ; 16.3.6 Session Management ; 16.4 Practical Problem: Login Application ; 16.5 Introduction to Java Server Pages ; 16.5.1 JSP Life Cycle ; 16.5.2 Steps in JSP Page Execution ; 16.5.3 JSP Elements ; 16.5.4 Placing Your JSP in the Webserver ; 16.6 Java Beans ; 16.6.1 Properties of a Bean ; 16.6.2 Using Beans through JSP ; 16.6.3 Calculatebean Example ; 16.7 Jar Files ; 16.7.1 Creating a Jar File ; 16.7.2 Viewing the Contents of a Jar File ; 16.7.3 Extracting the Contents of Jar ; 16.7.4 Manifest Files ; 16.8 Remote Method Invocation ; 16.8.1 RMI Networking Model ; 16.8.2 Creating an Rmi Application ; 16.9 Introduction to EJB ; 16.9.1 Types of EJB ; 16.9.2 EJB Architecture ; 16.9.3 Hello World-EJB Example ; Appendix A: Lab Manual ; Appendix B: Interview Questions ; Index

Zusatzinfo 168 illustrations
Verlagsort New Delhi
Sprache englisch
Maße 186 x 243 mm
Gewicht 976 g
Themenwelt Informatik Programmiersprachen / -werkzeuge Java
ISBN-10 0-19-809485-X / 019809485X
ISBN-13 978-0-19-809485-2 / 9780198094852
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
mit über 150 Workouts in Java und Python

von Luigi Lo Iacono; Stephan Wiefling; Michael Schneider

Buch (2023)
Carl Hanser (Verlag)
29,99
Einführung, Ausbildung, Praxis

von Christian Ullenboom

Buch | Hardcover (2023)
Rheinwerk (Verlag)
49,90