Java 2 In No Time

Java 2 In No Time

By (author) 

List price: US$27.96

Currently unavailable

Add to wishlist

AbeBooks may have this title (opens in new window).

Try AbeBooks

Description

Java 2 is becoming the popular language it always threatened to be. It has finally reached maturity, and many experienced developers are now beginning to use the language alongside their existing tools. This is also being driven by an increasing number of professional tools to support the language. This book is for somebody who needs a working knowledge of Java 2, and fast!show more

Product details

  • Paperback | 304 pages
  • 187 x 235 x 15mm | 576g
  • Pearson Education (US)
  • Prentice Hall
  • Upper Saddle River, United States
  • English
  • 0130949418
  • 9780130949417

Table of contents

Contents Preface 1 A brief introduction 3 What are programs? 7 What is a program? 8 Do you speak computer? 9 Byte code 9 From the idea to the program 12 About WindowsA (R), windows and consoles 15 All Java? 17 Programming is fun 18 Creating your own programs 21 Installation of the JDK 22 Further preparatory steps 25 The first program 30 Eliminating syntax mistakes 35 Structuring files 36 The first program 40 The program code 40 Comments 41 The import statement 41 Java packages 42 Classes, methods and variables 44 The main() method 44 Strings 45 The name of the source text file 45 Coding style 47 Numbers and texts in the Java programs 49 Variables and constants 50 Constants 50 Variables 51 Declaring variables 52 The data type - variables for any purpose 54 The meaning of the data type 54 The Java data types 58 Saving values in the variables 60 Initialising variables in the definition 62 Querying the values of the variables 62 Simultaneous queries and assignments 64 Working with numbers and texts 65 Calculations 66 Calculating mathematical formulae 67 Bracketing in expressions 69 Mathematical functions 71 Using the JDK documentation 72 Type strictness and type conversion 75 Using the trigonometric methods 78 Other counters 81 Combined assignments 81 Increment and decrement 82 Working with strings 83 Defining and assigning string variables 83 Adding strings to other strings 84 Special characters in strings 86 Manipulating strings 87 Recess: memory management for strings 89 Reading and outputting data 91 Outputting data on the console 92 Reading data from the console 92 Reading of input from the keyboard 93 Converting strings into numbers 93 Limiting decimal places 98 Adaptation of the Fahrenheit program 99 Comparing and branching 103 Comparing numbers and strings 104 Operators for comparisons 105 Comparing strings 105 Test on equality 105 Lexicographical comparisons 105 Yes or no? - The if branching 106 General syntax 108 Conditional execution of statements 108 The else alternative 112 Encapsulating if-else branching 114 The switch branch 114 Common syntax 114 How can I equip my statements with a menu? 115 The multiple execution of statements 121 What are loops used for? 122 The for loops 123 Common syntax 123 How are loops controlled? 123 Execution of a loop 124 Calculating number sequences using loops 126 Variants and traps 128 The while loop 129 Common syntax 129 Loops controlled by the user 129 Aborting loops prematurely 132 Aborting loop passages 132 Aborting loops 136 Bundling methods - activities 141 Defining and calling methods 142 Defining methods 142 Calling methods 144 Advantages of methods 146 Submitting parameters to methods 147 Parameters and arguments 147 Several parameters 149 Returning values from methods 150 Several return statements 151 Modularisation by means of methods 152 Scope of the variables 156 Common syntax methods 157 Arrays - processing 1000 data simultaneously 159 Declaring arrays 160 Accessing array elements 161 Arrays in loops 164 The object-oriented revolution 169 Thinking object-oriented 170 The class as a basis 171 Planning and mapping of a program to calculate vectors 172 A basic lesson 178 The class framework 179 Properties 181 Methods 182 The constructor 185 Arrays of objects 188 More about classes 191 Several constructors 192 Access specification 194 Private data elements - public methods 197 The vector program 200 Objects as parameters for methods 200 Call by reference 200 Arrays as parameters 203 Static methods 207 Summary 208 Inheritance 211 The basic idea 212 creating derived classes 214 Programming with files 223 Streams 224 Writing in files 225 Reading from files 229 The capital city quiz 232 The concept 232 The implementation 232 Conclusion and outlook 245 Applets 246 Applets in the Web 248 A first applet 249 The applet methods 250 Integrating applets into Web pages 254 Java programs with graphical user interface 258 Programming with control elements 259 Input masks for applets 263 Input masks for GUI applications 269 Debugging programs 273 Bases 273 The JDK debugger 274 Outlook 276 FAQs and typical omissions 275 FAQs 276 Typical beginners' errors 277 Glossary 281 Execution of the sample program 287 ASCII code and reserved keywords 289 ASCII code 290 Licence specification 291 Index 297show more