Advanced Java Programming

By Uttam K. Roy
Details Oxford University Press India
ISBN 9780199455508
Language English
Price 572.00 kr.
Paperback

Not in stock

Not in stock. Order now and have it delivered in appr. 12 working days

Advanced Java Programming is a textbook specially designed for undergraduate and postgraduate students of Computer Science, Information Technology, and Computer Applications (BE/BTech/BCA/ME/M.Tech/MCA). Divided into three parts, the book provides an exhaustive coverage of topics taught in advanced Java and other related subjects. It first introduces important language features such as Reflection, JNI, template, AWT and swing, Security etc. The second part primarily focuses on core network programming concepts such as sockets, RMI, Mail, XML-RPC etc. The state-of-the-art concepts such as SOAP, Applet, Servlet, JSP, JDBC, Hibernate, JMS, J2EE, JNDI, CORBA, JSF etc. have been discussed in the last part. The content is enhanced with numerous illustrations, examples, program codes, and screenshots. With its lucid presentation and inclusion of numerous real-world examples and codes, the book will be equally useful for Java professionals.


PART I: INSIDE JAVA
11. Java Tools
31.1 Introduction
31.2 Javadoc
31.3 Javap
71.4 Jcmd
91.5 Jhat
121.6 Jdb
131.7 Jar
181.7.1 Syntax
191.7.2 Creating a JAR File
191.7.3 Viewing Contents of a JAR File
201.7.4 Extracting the Content
201.7.5 Updating a JAR File
211.7.6 Manifest File
212. Exception Handling
262.1 Exceptions
262.2 Handling Exceptions
272.3 An Example
282.4 Types of Exceptions
282.4.1 Checked Exceptions
292.4.2 Unchecked/Runtime Exceptions
292.5 Catching Exception
292.6 Tracing Stack
302.6.1 Multiple Catch Blocks
302.6.2 throw
312.6.3 throws
332.6.4 finally
342.6.4.1 An example
352.6.4.2 Some properties
362.6.5 try-with-resources Statement
372.6.6 Nested try-catch 392.7 Custom Exception Classes
403. Multi-threading
453.1 Introduction
453.2 Main Thread
453.3 Using Sleep
463.4 Creating Thread
473.4.1 Extending Thread
473.4.2 Implementing Runnable
483.5 Interrupting Thread
493.6 Suspending and Resuming
513.7 Thread Priority
523.8 Using join()
533.9 Synchronization
553.9.1 Synchronization and Atomicity
594.13 Accessing GC from Java Program
834.13.1 Inspecting GC Parameters
834.13.2 Explicit Garbage Collection
844.13.3 finalize()
844.14 Appendix
845. Collection Framework
925.1 Introduction
925.2 Benefits
935.3 Collection Interfaces
945.4 Collection Implementation
955.4.1 Set
955.4.1.1 HashSet
965.4.1.2 LinkedHashSet
975.4.2 SortedSet
985.4.2.1 TreeSet
985.4.3 List
985.4.3.1 ArrayList
995.4.3.2 LinkedList
1005.4.4 Queue
1005.4.4.1 LinkedList
1015.4.4.2 PriorityQueue
1025.4.5 Map
1025.4.5.1 HashMap
1035.4.5.2 LinkedHashMap
1045.4.6 SortedMap
1055.4.6.1 TreeMap
1055.5 Algorithms
1055.5.1 Sorting
1065.5.1.1 Custom sort
1065.5.2 Shuffling
1065.5.3 Manipulation
1075.5.3.1 Reversing
1075.5.3.2 Swapping
1075.5.3.3 Copying
1075.5.3.4 Filling
1075.5.3.5 Adding
1075.5.4 Searching
1085.5.5 Finding Extreme Values
1085.5.6 Counting Frequency
1086. Generic Programming
1136.1 Introduction
1136.2 Motivation
1146.3 Solution
1146.4 Collection Framework and Generics
1166.5 Type Naming
1176.6 Generic Methods and Constructors
1176.7 Type Inference
1186.7.1 Generic Methods
1186.7.2 Constructors
1196.7.3 Classes
196.8 Bounded Type Parameters
1196.8.1 Multiple Bounds
1206.9 Generics and Sub-type
1216.10 Wildcards
1226.10.1 Upper-bound Wildcard
1236.10.2 Lower-bound Wildcard
1246.10.3 Unbounded Wildcard
1246.10.4 Wildcard and Sub-typing
1256.11 Type Erasure
1256.12 Backward Compatibility
1266.13 Restrictions on Generics
1276.13.1 Cannot Specify Primitive Type Arguments
1276.13.2 Cannot Declare Static Fields of Type Parameters
1276.13.3 Cannot Create Instances of Type Parameters
1276.13.4 Cannot Use instanceof
1286.13.5 Cannot Create Generic Arrays
1286.13.6 Limitations on Exception
1286.13.7 Cannot Use
.class
1297. Reflection
1337.1 Introduction
1337.1.1 Pros and Cons of Reflection
1337.2 Classes
1347.2.1 Class
1347.2.1.1 Using getClass()
1347.2.1.2 Using
.class
1357.2.1.3 Using forName()
1357.2.1.4 Using TYPE field
1367.2.2 Modifier
1367.3 Inspecting Class
1377.3.1 Getting Class Information
1377.3.2 Getting Class Modifiers
1387.3.3 Finding Implemented Interfaces
1387.3.4 Finding Inheritance Hierarchy
1397.3.5 Finding Annotations
1397.4 Finding Class Members
1407.4.1 Getting Fields
1407.4.2 Getting Methods
1427.4.3 Getting Constructors
1437.5 Working with Class Members
1437.5.1 Field Type
1437.5.2 Field Modifiers
1447.5.3 Accessing Fields
1447.5.3.1 Accessing forbidden fields
1457.5.3.2 Modifying final fields
1457.5.4 Method Modifiers
1467.5.5 Method Information
1467.5.6 Invoking Methods
1477.5.6.1 Accessing forbidden methods
1477.5.7 Debugging with Reflection
1487.5.8 Getting Constructor Modifiers
1497.5.9 Instantiating Objects
1497.5.10 Arrays
1507.5.10.1 Checking array types
1507.5.10.2 Creating new arrays
1517.6 Dynamic Proxy
1517.6.1 Designing Dynamic Proxy
1517.6.2 Invocation Handlers
1537.7 Disadvantage of Reflection
1558. Java Native Interface
1588.1 Introduction
1588.2 Java Program with C/C++
1598.2.1 Writing Java Program
1598.2.2 Compiling Java Program
1608.2.3 Create Header File
1608.2.4 Implement Native Method
1618.2.5 Create Shared Library
1628.2.6 Running the Program
1628.3 Using C++
1638.4 Syntax Difference in C/C++
1638.5 Using Java Package
1648.5.1 JNI Types and Data Structures
1658.6 Passing Arguments
1678.6.1 Passing Primitives
1678.6.2 Passing Strings
1688.6.3 Passing Primitive Array
1698.7 Accessing Java Code from Native Program
1718.7.1 Passing Object Array
1728.8 Creating Objects
1748.9 Exception Handling in JNI
1748.10 Appendix
1779. AWT and Swing
1829.1 Introduction
1829.2 AWT Class Hierarchy
1839.2.1 Component
1839.2.2 Container
1839.2.3 Controls
1859.3 Creating Container
1859.3.1 Empty Frame
1859.3.2 Frame with a Title
1859.4 Adding Components
1869.4.1 Adding a Label
1869.4.2 Adding a Button
1869.5 Layout
1879.5.1 FlowLayout
1879.5.2 GridLayout
1879.5.3 BorderLayout
1889.6 Using Panel
1899.7 Text Field
1899.8 TextArea
1909.9 List
1909.10 Checkbox
1919.11 Check Box Group
1919.12 Choice
1929.13 Event Handling
1929.13.1 Event Sources
1929.13.2 Event Classes
1929.13.3 Event Listeners
1949.13.4 Example
1949.13.5 Adapter Classes
1979.14 Dialog Boxes
1989.14.1 Simple Dialog
1989.14.2 File Dialog
1999.15 ScrollBar
2009.16 Menu
2009.16.1 Popup Menu
2019.17 Swing
2029.17.1 Containment Hierarchy
2039.17.2 Adding Components
2039.17.3 JTextField
2039.17.4 JPasswordField
2049.17.5 JTable
2049.17.6 JComboBox
2059.17.7 JProgressBar
2059.17.8 JList
2069.17.9 JTree
2079.17.10 JColorChooser
2099.17.11 Dialogs
2109.17.12 Appendix A: Methods of Important Event Listener Interfaces
21210. Java and XML
21710.1 Introduction
21710.2 XML and DOM
21710.3 DOM Nodes
21910.4 The Node Interface
22110.4.1 Node Properties
22110.5 Document Node
22510.5.1 Document Node Properties
22510.5.2 Document Node Methods
22510.6 Element Node
22710.6.1 Element Node Properties
22710.6.2 Element Node Methods
22710.7 Text Node
22810.7.1 Text Node Properties
22810.7.2 Text Node Methods
22810.8 Attr Node
22910.8.1 Attr Node Properties
22910.9 Parsing XML
22910.9.1 Creating Document
23010.9.2 Navigating DOM Tree
23010.9.2.1 Using root node
23010.9.2.2 Getting all child nodes
23110.9.2.3 Using getElements ByTagName
23210.9.2.4 Using getElementById
23310.9.2.5 Getting attributes of an element
23310.9.2.6 Viewing DOM
23510.9.3 Manipulating DOM Tree
23610.9.3.1 Creating a node
23610.9.3.2 Setting an attribute
23710.9.3.3 Adding a node
23710.9.3.4 Inserting a node
23810.9.3.5 Deleting a node
23910.9.3.6 Cloning a node
24010.9.4 Java DTD Validation
24111. Input/Output
24711.1 Introduction
24711.2 Streams
24711.2.1 Byte Stream
24911.2.2 Character Stream
25111.2.3 Bridging Stream
25111.2.4 Buffered Stream
25211.2.4.1 Buffered byte stream
25211.2.4.2 Buffered character stream
25211.2.5 Reading from Keyboard
25311.2.5.1 Reading character
25311.2.5.2 Reading string
25311.2.6 Console
25411.3 Formatting
25411.4 Data Streams
25511.5 Object Stream
25511.6 Reading/writing Arrays via Streams
25611.7 Pipes
25611.8 File I/O
25811.9 Path
25811.9.1 Creating a Path
25811.9.2 Retrieving Path Information
25811.9.3 Path Operations
25911.9.3.1 Removing redundancy
25911.9.3.2 Converting to URI
25911.9.3.3 Joining paths
25911.9.4 Comparing Paths
25911.10 File
26011.10.1 Checking Existence
26011.10.2 Creating File
26011.10.3 Deleting File
26011.10.4 Copying a File
26011.10.5 File Attribute
26111.10.6 Reading, Writing, Creating Files
26111.10.7 Random Access Files
26211.10.8 W orking with Directories
26311.10.8.1 Listing Directory Contents
26311.10.9 Walking Directory Tree
26311.10.10 Watching Directory 264PART II: NETWORK PROGRAMMING
27112. Basic Networking
27312.1 Java and the Net
27312.2 Java Networking Classes and Interfaces
27312.3 Getting Network Interfaces
27412.3.1 Getting Interface Addresses
27512.3.2 Getting Interface Properties
27612.4 URL
27712.4.1 Creating URL
27712.4.2 Parsing URL
27712.4.3 Web Page Retrieval
27812.5 URLConnection
27912.6 HttpURLConnection
28012.6.1 URLEncoder/URLDecoder
28112.7 Proxy
28312.7.1 Using Command Line Arguments
28312.7.2 Using System Properties
28312.7.3 Using Proxy Class
28312.8 ProxySelector
28313. Socket Programming
28713.1 Introduction
28713.2 Client/server Programs
28813.3 Sockets
28913.3.1 Types of Socket
29013.3.2 Ports
29013.3.3 Socket Address
29013.3.4 Socket Address and Java
29113.3.5 Reserved Ports
29113.4 TCP Sockets
29213.4.1 The ServerSocket Class
29413.4.2 The Socket Class
29613.4.3 An Application
29713.4.4 Complete Example
29813.4.5 Running Example Program
29913.4.6 Handling Multiple Client Requests
30013.4.6.1 Iterative solution
30013.4.7 Concurrently Solution
30213.4.8 Sending and Receiving Objects Using TCP
30613.4.8.1 Serializing an object
30613.4.8.2 Reconstructing objects
30813.4.9 An Example
30913.4.10 Writing the Server
31013.4.10.1 Writing interfaces
31013.4.10.2 Implementing interfaces
31013.4.10.3 Implementing server
31113.4.10.4 Implementing client
31213.4.10.5 Running the example
31313.5 UDP Sockets
31313.5.1 Datagram Packets
31513.5.2 Datagram Server
31513.5.3 Datagram Client
31713.5.4 Receiving Multiple Datagrams
31913.5.5 Sending and Receiving Objects Using UDP
32113.5.6 Sending an Object
32113.5.7 Reconstructing the Object
32213.5.8 Running the Application
32313.6 Multicasting
32313.7 Multicast Sockets
32313.7.1 Multicast Addresses
32413.7.2 MulticastSocket Class
32513.7.3 Sending Data
32613.7.4 Receiving Data
32613.7.5 Complete Example
32713.7.6 Another Multicasting Example
32813.7.7 A Text Conference Example
33013.8 Appendix A (Useful Methods of ServerSocket Class)
33213.8.1 Constructors
33213.8.2 Methods
33213.9 Appendix B (Useful Methods of Socket Class)
33413.9.1 Constructors
33413.9.2 Methods
33513.10 Appendix C (Useful Methods of DatagramSocket Class)
33813.10.1 Constructors
33813.10.2 Methods
33813.11 Appendix D (Useful Methods of DatagramPacket Class)
34113.11.1 Constructors
34113.11.2 Methods
34213.12 Appendix E (Useful Methods of MulticastSocket Class)
34313.12.1 Constructors
34313.12.2 Methods 343