We are living in an era of digital revolution. On the horizon, many emerging digital technologies are being developed at a breathtaking speed. Whether we like it or not, whether we are ready or not, digital technologies are going to penetrate more and more, deeper and deeper, into every aspect of our lives. This is going to fundamentally change how we live, how we work, and how we socialize.
Java, as a modern high-level programming language, is an excellent tool for helping us to learn these digital technologies, as well as to develop digital applications, such as IoT, AI, Cybersecurity, Blockchain and more. Practical Java Programming uses Java as a tool to help you learn these new digital technologies and to be better prepared for the future changes.
* Gives you a brief overview for getting started with Java Programming
* Dives into how you can apply your new knowledge to some of the biggest trending applications today
* Helps you understand how to program Java to interact with operating systems, networking, and mobile applications
* Shows you how Java can be used in trending tech applications such as IoT (Internet of Things), AI (Artificial Intelligence), Cybersecurity, and Blockchain
Get ready to find out firsthand how Java can be used for connected home devices, healthcare, the cloud, and all the hottest tech applications.
PERRY XIAO, PHD, is an Associate Professor and Course Director of London South Bank University. He teaches undergraduate and postgraduate students in the areas of electronics, software programming, and computer networks. Dr. Xiao has designed and taught several modules focused on Java programming. He is also a director and cofounder of Biox Systems Ltd, a university spin-out company that designs and manufactures the AquaFlux and Epsilon Permittivity Imaging systems.
Author(s): Perry Xiao
Edition: 1
Publisher: Wiley
Year: 2019
Language: English
Pages: 483
Cover......Page 1
Title Page......Page 5
Copyright......Page 6
About the Author......Page 9
Acknowledgments......Page 11
Contents......Page 13
Preface......Page 21
How This Book Is Organized......Page 23
Who This Book Is For......Page 24
Suggested Prerequisite Reading......Page 25
What You Need......Page 26
Part I......Page 27
1.1 What Is Java?......Page 29
1.2 Versions of Java......Page 31
1.3 Java Architecture......Page 33
1.4 Editions of Java......Page 34
1.5 The Java Spring Framework......Page 35
1.6.1 Advantages......Page 36
1.7 Java Certification......Page 37
1.9 Chapter Review Questions......Page 38
2.1 Downloading and Installing Java......Page 39
2.2 Java IDEs......Page 43
2.3 Java Hello World Program......Page 46
2.4 Java Online Compilers......Page 51
2.6 Java Free Online Courses and Tutorials......Page 57
2.7 Java Version Control......Page 62
2.8 Summary......Page 63
2.9 Chapter Review Questions......Page 64
Part II......Page 65
Chapter 3 Basic Java Programming......Page 67
3.2 Variables......Page 68
3.2.1 Constants......Page 70
3.2.2 The String and StringBuffer Types......Page 71
3.2.3 The VAR Variable Type......Page 72
3.3 Operators......Page 73
3.5 Input and Output......Page 74
3.6 Loops and Selections......Page 77
3.7 Arrays, Matrices, and ArrayLists......Page 80
3.8 Reading and Writing Files......Page 84
3.9 Methods......Page 86
3.10.1 Classes and Objects......Page 88
3.10.6 Polymorphism......Page 89
3.10.8 Anonymous Inner Classes......Page 90
3.11 Multithreading......Page 94
3.11.1 The Life Cycle of a Thread......Page 99
3.11.3 Thread Scheduling......Page 102
3.11.4 Thread Synchronization......Page 103
3.12 Date, Time, Timer, and Sleep Methods......Page 104
3.13 Executing System Commands......Page 109
3.14 Packages and Programming on a Large Scale......Page 112
3.15 Software Engineering......Page 114
3.15.1 The Software Development Cycle......Page 115
3.15.2 Indentation......Page 116
3.15.3 Comments......Page 117
3.15.4 Naming Conventions......Page 118
3.16.1 Using a Windows Batch File......Page 119
3.16.2 Using an Executable JAR File......Page 120
3.16.3 Using Microsoft Visual Studio......Page 121
3.16.4 Java Application Installations......Page 122
3.18 Chapter Review Questions......Page 124
4.1 Introduction......Page 125
4.2 Java Swing Applications......Page 126
4.3 JavaFX Applications......Page 131
4.3.1 JavaFX Window......Page 132
4.3.2 Creating a Label and Button in JavaFX......Page 134
4.3.3 JavaFX Charts......Page 136
4.3.4 Handling Logins in JavaFX......Page 138
4.3.5 Creating an Image Viewer in JavaFX......Page 141
4.3.6 Creating a JavaFX Web Viewer......Page 143
4.3.7 Creating a Menu in JavaFX......Page 144
4.3.8 Creating a JavaFX File Chooser......Page 146
4.3.9 JavaFX Tutorials......Page 148
4.4 Deploying JavaFX Applications......Page 151
4.6 Chapter Review Questions......Page 153
5.1 Introduction......Page 155
5.1.2 The Cisco Three-Tier Enterprise Network Architecture......Page 158
5.1.3 Key Network Components......Page 159
5.1.4 Traditional Networks vs. Software-Defined Networking......Page 160
5.2 Java Network Information Programming......Page 162
5.3.1 Java UDP Client-Server Programming......Page 169
5.3.2 Java TCP Client-Server Programming......Page 172
5.3.3 Java Multithreaded EchoServer Programming......Page 174
5.4.1 A Java HTTP/HTTPS Client......Page 177
5.4.2 A Java HTTP Server......Page 184
5.4.3 Java Multithreaded HTTP Server......Page 185
5.5 Java Email SMTP Programming......Page 190
5.6 Java RMI Client-Server Programming......Page 194
5.7.1 Getting Started with OpenFlow......Page 198
5.8 Java Network Programming Resources......Page 207
5.10 Chapter Review Questions......Page 208
6.1 Introduction......Page 209
6.2 Android Studio......Page 210
6.3 The Hello World App......Page 212
6.4 The Button and TextView Apps......Page 218
6.5 The Sensor App......Page 222
6.6 Deploying Android Apps......Page 226
6.7 The Activity Life Cycle of an Android App......Page 228
Speech Recognition App......Page 230
Translation App......Page 234
6.9 5G......Page 239
6.9.3 Massive MIMO......Page 243
6.9.6 Future 6G and 7G......Page 244
6.11 Chapter Review Questions......Page 245
Part III......Page 247
7.1 What Is the Internet of Things?......Page 249
7.2 IoT Communication Protocols......Page 253
7.2.1 MQTT......Page 254
7.2.5 REST......Page 255
7.5 Why Java?......Page 256
7.6 Java IoT with Raspberry Pi......Page 257
7.6.1 Raspberry Pi Setup......Page 258
7.6.2 Java GPIO Examples......Page 263
7.6.3 Running Python Programs from Java......Page 270
7.6.4 Java PWM Example......Page 272
7.6.5 Java PIR and LED Example......Page 274
7.6.6 Java I2C Example......Page 277
7.6.7 Java ADC Examples......Page 281
7.6.8 Java Digital Sensor Examples......Page 285
7.6.9 Java MQTT Example......Page 289
7.6.10 Java REST Example......Page 292
7.7 An Oracle Java ME Embedded Client......Page 296
7.8.2 IBM Watson IoT for Java......Page 297
7.8.4 Microsoft Azure IoT for Java......Page 298
7.10 Chapter Review Questions......Page 299
8.1 What Is Artificial Intelligence?......Page 301
8.1.1 History of AI......Page 303
8.1.2 Cloud AI vs. Edge AI......Page 305
8.2.1 The Perceptron......Page 306
8.2.2 MultiLayered Perceptron/Backpropagation/Feedforward......Page 310
8.3 Machine Learning......Page 312
8.4 Deep Learning......Page 314
8.5 Java AI Libraries......Page 318
8.6.1 Java Perceptron Example......Page 319
8.6.2 Java Neural Network Backpropagation Example......Page 322
8.7 Java Examples for Machine Learning......Page 326
8.8 Java Examples for Deep Learning......Page 329
8.9 TensorFlow for Java......Page 335
8.11 Summary......Page 339
8.12 Chapter Review Questions......Page 340
9.1 What Is Cybersecurity?......Page 341
9.2 What Is Encryption?......Page 342
9.2.1 Private Key Encryption......Page 343
9.2.2 Public Key Encryption......Page 345
9.3 Hash Functions and Message Digests......Page 347
9.4 Digital Signatures......Page 349
9.5 Digital Certificates......Page 351
9.6 Case Study 1: Secure Email......Page 353
9.7 Case Study 2: Secure Web......Page 354
9.8 Java Private Key Encryption Example......Page 355
9.9 Java Public Key Encryption Example......Page 356
9.10 Java Digital Signature/Message Digest Example......Page 358
9.11 Java Digital Certificate Example......Page 364
9.12 Other Java Examples......Page 368
9.13 Summary......Page 371
9.14 Chapter Review Questions......Page 372
10.1 What Is Blockchain?......Page 373
10.2 How Do You Validate a Blockchain?......Page 375
10.4 How Does Blockchain Work?......Page 376
10.5 Uses of Blockchain......Page 378
10.5.1 Bitcoin......Page 379
10.5.3 Healthcare......Page 384
10.5.5 Internet of Things......Page 385
10.6 Issues with Blockchain......Page 386
10.7 Java Blockchain Examples......Page 387
10.8 Java Blockchain Transaction Examples......Page 393
10.9 Java BitcoinJ Example......Page 399
10.10 Java Web3j Examples......Page 401
10.11 Java EthereumJ Examples......Page 404
10.12 Java Ethereum Smart Contract Example......Page 406
10.13 Go Further: Choosing a Blockchain Platform......Page 412
10.14 Summary......Page 413
10.15 Chapter Review Questions......Page 414
11.1 What Is Big Data?......Page 415
11.2 Sources of Big Data......Page 416
11.3 The Three Vs of Big Data......Page 417
11.5 What Is Hadoop?......Page 418
11.6.1 HDFS......Page 419
11.6.2 MapReduce......Page 420
11.6.5 Overview of a Hadoop Cluster......Page 421
11.7 Implementing Hadoop on a Raspberry Pi Cluster......Page 422
11.7.2 Hadoop Installation and Configuration......Page 423
Download and Install Hadoop......Page 424
Configure Hadoop......Page 425
Test Hadoop......Page 427
Hadoop on a Web Browser......Page 429
11.8 Java Hadoop Example......Page 432
11.10 Chapter Review Questions......Page 438
Javadoc Tutorial......Page 439
JAR Tutorial......Page 444
Useful Java Resources......Page 446
Downloading Maven......Page 449
Creating a Maven Project......Page 450
Running the Maven Project......Page 454
Appendix C Git and GitHub Tutorial......Page 457
Terms and Definitions......Page 466
Cheat Sheet......Page 468
Index......Page 471
EULA......Page 483