Published in 2018 by Cavendish Square Publishing, LLC
243 5th Avenue, Suite 136, New York, NY 10016
Copyright 2018 by Cavendish Square Publishing, LLC
First Edition
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any meanselectronic, mechanical, photocopying, recording, or otherwise without the prior permission of the copyright owner. Request for permission should be addressed to Permissions, Cavendish Square Publishing, 243 5th Avenue, Suite 136, New York, NY 10016. Tel (877) 980-4450; fax (877) 980-4454.
Website: cavendishsq.com
This publication represents the opinions and views of the author based on his or her personal experience, knowledge, and research. The information in this book serves as a general guide only. The author and publisher have used their best efforts in preparing this book and disclaim liability rising directly or indirectly from the use and application of this book.
All websites were available and accurate when this book was sent to press.
Library of Congress Cataloging-in-Publication Data
Names: Ryan, Aidan M.
Title: The power of Java / Aidan M. Ryan.
Description: New York : Cavendish Square, 2018. | Series: The power of coding |
Includes bibliographical references and index. | Audience: Grades 9-12.
Identifiers: ISBN 9781502629425 (library bound) | ISBN 9781502634177 (pbk.) | ISBN 9781502629432 (ebook) Subjects: LCSH: JavaScript (Computer program language)--Juvenile literature.
Classification: LCC QA76.73.J39 R93 2018 | DDC 005.2762--dc23
Editorial Director: David McNamara Editor: Caitlyn Miller Copy Editor: Rebecca Rohan Associate Art Director: Amy Greenan Designer: Alan Sliwinski Production Assistant: Karol Szymczuk
The photographs in this book are used by permission and through the courtesy of: Cover, p. 1 Hero Images Inc./Alamy Stock Photo; Throughout book Prachatree/Shutterstock.com; p. 4 left kr7ysztof/E+/Getty Images; p. 4 right wavebreakmedia/Shutterstock.com; p. 8 Drew Angerer/Getty Images; p. 11 Stefan Sollfors/Alamy Stock Photo; p. 24 A Prabhakar Rao/The India Today Group/Getty Images; p. 26 bizoo_n/ iStock; p. 28 Timofeev Vladimir/Shutterstock.com; p. 30 DeymosHR/Shutterstock.com; p. 34 Colport/ Alamy Stock Photo; p. 44 Marinka Alisen/Shutterstock.com; p. 47 Arun Reginald/Wikimedia Commons/ File:How JIT Compilation works.svg/CC BY-SA 3.0; p. 50 KidStock/Blend Images/Getty Images; p. 52 Photo Researchers/Science History Images/Alamy Stock Photo; p. 53 Victoria Will/AP Images for Japan Prize Foundation; p. 58 Hank Morgan - Rainbow/Science Faction/Getty Images; p. 68 Monika Skolimowska/ picture-alliance/dpa/AP Images; p. 70 download.net.pl - mobile/Flickr/CC BY-SA 2.0; p. 72 Ollyy/ Shutterstock.com; p. 74 mark Peterson/Corbis Historical/Getty Images; p. 77 Truth Leem/Reuters/Alamy Stock Photo; p. 81 Tristan Deloche/Wikimedia Commons/File:TIOBE Index on February 24th, 2017. png/CC BY-SA 4.0; p. 82 Michael Kolling and Paul Henriksen/Wikimedia Commons/File:Greenfoot Screenshot.jpg/CC BY-SA p. 89 Renee French/Wikimedia Commons/File:Gogophercolor.png/CC GNU LGPL; p. 93 A.F. Archive/Alamy Stock Photo; p. 96 elenabsl/Shutterstock.com; p. 98 lushik/iStock.
Opposite: Your text messages may be short, but millions of lines of code are working behind each one .
The History of Java
B etween the time you wake up and the time you fall back asleep, you probably watch TV, browse the internet , use apps on a smartphone, and connect to Wi-Fi through a routerand most of these things youll do multiple times in a day. In the same day, you might swipe a credit card, use a Kindle or other e-reader, take cash out of an ATM, pay for parking at an electronic meter, print something, and set or disarm a home security system. You dont usually spend much time thinking about all these things. Some of the actions are automatic, theyre so much a part of daily life in the twenty-first century.
But none of this would be possible if, decades ago, a few wildly inventive people hadnt dreamed about groundbreaking new ways humans could interact with machines and with each other. They dreamed that instead of just using computers to create plain old text and pictures that didnt move, and using the internet to share these, people could interact with responsive computers. That could mean something as simple as clicking and dragging files across a screen to your desktops recycling bin, or something as complex as running an airplanes control systems. A computer programming language a language that humans write, but that only machines can speakis what makes all this possible. There are hundreds of these languages, and all have different strengths and functions. One that powers cable TV, internet routers, smartphone apps, and household electronics is called Java. Java has shaped the modern world, and whether you realize it or not, you use it every day.
Java in Your World: Smartphones and Pokemon Go
The summer of 2016 was hot. According to American climate scientists, 2016 was the hottest year ever recorded on Earth, and July and August were the hottest months of that year. Usually temperatures that high keep people indoors, in the comfort of air conditioning, or at least close to fans and cold drinks. But that summer, many people chose to spend more time outdoors.
Through July and August, almost everywhere you went outside, youd see people walking back and forth over sidewalks and lawns, in no apparent pattern, heads bent down to smartphone screens. There was something hotter than the temperatures that summer: a new, simple smartphone app called Pokemon Go.
On July 6, video game company Nintendo, along with game development company Niantic, released a game that would reboot a twenty-year-old brand called Pokemon and at the same time change the way both kids and adults interacted with their phones and with each other. It wasnt just a fadit was a phenomenon. The game became the fastest-growing appor application , a name for any computer program, from massive games to tiny tools like calculatorsin the history of smartphones. Today, it stands as the most popular smartphone game ever. Only six months after it launched, the app had earned its makers $1 billion.
Digital characters hovered over real tables and chairs, seemed to hide behind trees and bushes, and lurked in lakes and graveyards, ready to be captured.
The potential dangers of playing Pokemon Go became clear soon after it was released . This sign was posted in New York City the summer of 2016 .
Players could train their Pokemon to fight. The winners of these battles were rewarded with control of virtual gyms scattered around the real world over places like libraries, schools, parks, and coffee shops. It didnt matter what brand of smartphone or tablet you had: anyone could play. The game was popular, and sometimes dangerous; some players were so distracted that they broke bones, crashed cars, or were robbed. One newspaper reported that players caused over 110,000 road accidents in just ten days.