Java : practical guide for programmers

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Author(s): Zbigniew M Sikora
Publisher:

Language: English
Pages: 197

Java : Practical Guide for Programmers......Page 1
Preface......Page 13
Acknowledgments......Page 14
1.1 Simple Java Application......Page 21
1.2.1 javac......Page 24
1.3 Language Features......Page 25
Basic Language Syntax......Page 27
2.2 Statements......Page 28
2.3 Variables......Page 29
2.4 Constants......Page 30
2.5.1 Integer Numbers......Page 31
2.5.3 Booleans......Page 33
2.5.5 Strings......Page 34
2.5.6 Arrays......Page 36
2.6 Arithmetic Operations......Page 39
2.7 Data Type Conversion......Page 41
3.1.1 if Statement......Page 42
3.1.2 if else Statement......Page 43
3.1.3 else if Statement......Page 44
3.1.5 Switch Statement......Page 45
3.2 Relational and Logical Operators......Page 47
3.3 Iteration Statements......Page 49
3.3.2 do while Loop......Page 50
3.3.3 for Loop......Page 51
3.3.4 break and continue Statements......Page 52
4.1 Class and Object with No Methods......Page 54
4.2 Class with Methods......Page 56
4.3 Constructors......Page 58
4.4 Method Overloading......Page 60
4.5 Argument Passing in Java......Page 61
4.6 Instance and Static Variables......Page 63
4.7 Instance and Static Methods......Page 65
4.8 this Keyword......Page 66
4.10 Vectors......Page 68
4.11 Object Wrappers......Page 69
5.1 Creating Subclasses......Page 71
5.2.1 equals Method......Page 75
5.2.3 toString Method......Page 78
5.2.4 instanceof Operator......Page 79
5.3 Abstract Classes and Methods......Page 80
5.4 Interfaces......Page 82
5.5 Packages......Page 83
5.5.1 classpath Option......Page 86
5.6 Access Control......Page 87
5.7 Inner Classes......Page 92
6.1 Exception Handling......Page 94
6.2 Java Exception Classes......Page 97
6.3 Creating Exception Classes......Page 98
6.4 Propagation of Exceptions......Page 99
6.5 Runtime Exceptions......Page 102
6.6 Assertions......Page 104
Input/Output......Page 106
7.1 Terminal I/O Example......Page 108
7.2 FileReader and FileWriter Streams......Page 109
7.2.1 FileWriter Example......Page 110
7.2.2 The write Method......Page 111
7.2.4 The PrintWriter Stream......Page 112
7.2.5 FileReader Example......Page 114
7.2.6 Using FileNotFoundException......Page 115
7.3 FileInputStream and FileOutputStream......Page 116
7.4 Buffered Input and Output Streams......Page 117
7.4.1 BufferedWriter Example......Page 118
7.4.3 BufferedReader Example......Page 119
7.5.1 DataOutputStream Example......Page 120
7.5.2 DataInputStream Example......Page 122
7.6 Random Access Files......Page 123
7.6.1 Writing to a Random Access File......Page 124
7.6.2 Reading from a Random Access File......Page 125
7.7 Object Serialization......Page 126
7.7.1 Controlling Serialization......Page 130
7.7.2 The jar Tool......Page 131
8.1 Introduction......Page 132
8.2 Swing Components......Page 133
8.2.1 Button......Page 134
8.2.3 Check Box Button......Page 137
8.2.5 Text Field......Page 138
8.2.7 Label......Page 139
8.2.8 List......Page 140
8.3.1 Borders......Page 141
8.3.4 Enabling and Disabling Components......Page 142
8.4.1 Top-Level Containers......Page 143
8.4.2 Dialogues......Page 144
8.4.3 Intermediate-Level Containers......Page 145
8.5 Layouts......Page 146
8.5.1 FlowLayout......Page 147
8.5.2 BorderLayout......Page 148
8.6 Specifying Look and Feel......Page 149
8.7 Event Handling......Page 150
8.7.1 ActionListener......Page 152
8.7.2 ItemListener......Page 153
8.7.3 ListSelectionListener......Page 154
8.7.4 Adapters in Event Handling......Page 155
8.8 Painting with Swing......Page 157
8.9 CustomerDetails Example......Page 158
8.10 Applets......Page 163
8.10.1 Swing Applets......Page 166
8.10.2 Applet Life Cycle Methods......Page 168
8.10.3 Applet Security......Page 169
Collections......Page 170
9.1 Set Interface......Page 171
9.1.1 SortedSet Interface......Page 174
9.1.2 Implementing the Comparable Interface......Page 175
9.2 List Interface......Page 178
9.3 Map Interface......Page 180
9.3.1 SortedMap Interface......Page 182
9.4 The Collections Class......Page 183
10.2 Multithreaded Application Example......Page 185
10.4 The Runnable Interface......Page 188
10.4.1 Finite Applet Thread Example......Page 189
10.4.2 Infinite Applet Thread Example......Page 191
10.5 Synchronizing Threads......Page 193
10.6 Thread States......Page 194
Operator Precedence......Page 195
Swing Events......Page 196