JAVA — CHAPTER 1

Intro, Test-Driving a Java App & Generative AI · Concept Cheat Sheet
Hardware & Software Java & OOP JVM Pipeline Cloud · IoT · Big Data Generative AI
1 COMPUTER & SOFTWARE FUNDAMENTALS

Hardware units

  • Input (keyboard, mic, sensors)
  • Output (screen, speaker)
  • Memory (fast, volatile)
  • Secondary storage (SSD/disk)
  • CPU + GPU (arithmetic/logic + parallel math)

Language levels

  • Machine language — pure 0s & 1s
  • Assembly — mnemonics (ADD, MOV)
  • High-level (Java, Python) — English-like
  • Compilers/interpreters translate high-level → machine code

Programming paradigm

  • Procedural — step-by-step instructions
  • Object-oriented — models real-world "things"
  • Java is class-based, object-oriented

Key idea

A computer is a general-purpose machine — hardware is the physical device, software (programs) tells it what to do. Java programs are software that run on any device with a JVM.

2 WHAT MAKES JAVA, JAVA?

Origins

  • Created by James Gosling at Sun Microsystems (1991, "Project Green")
  • Now owned & developed by Oracle
  • One of the most used languages for apps, web back-ends, Android

Core traits

  • WORA — Write Once, Run Anywhere
  • Compiled to bytecode, run by the JVM
  • Automatic memory management (garbage collection)
  • Strongly typed & security-checked at multiple stages

Java editions

  • Java SE — Standard Edition (desktop/console apps)
  • Jakarta/Java EE — enterprise, web servers
  • Java ME — embedded/small devices
3 OBJECT ORIENTATION — QUICK REVIEW

Core vocabulary

  • Class — blueprint (e.g., Car)
  • Object — an instance built from the class
  • Attributes — data an object carries (color, speed)
  • Methods — behaviors an object can perform (accelerate())

Four pillars

  • Encapsulation — bundle data + behavior, hide internals
  • Inheritance — new class reuses/extends an existing one
  • Polymorphism — one method call, many object-specific behaviors
  • Abstraction — expose what an object does, not how
4 JAVA API & OPEN-SOURCE LIBRARIES

Java API

Thousands of prebuilt classes (java.lang, java.util, java.io…) so you don't reinvent common functionality.

Why reuse?

  • Faster development
  • Fewer bugs — code is already tested
  • Consistent, well-documented behavior

Build tools & repos

  • Maven / Gradle — manage project dependencies
  • Open-source libs downloaded from public repositories
  • Community libraries extend what the core API offers
5 HOW A JAVA PROGRAM RUNS
✍️ Edit
write .java file
⚙️ Compile
javac → .class bytecode
🧩 Class Loader
loads .class into JVM
🔒 Bytecode Verifier
checks for safety/security
▶️ Execute
java interprets/JIT-compiles
// Test-drive: compile then run from the terminal javac Welcome.java // produces Welcome.class (bytecode) java Welcome // JVM loads & runs the bytecode
6 THE CONNECTED WORLD

Internet & Web

Global network of networks; the Web is the system of linked pages/apps that run over it.

Cloud computing

Storage & computing power delivered as a service over the internet instead of on local machines.

Internet of Things

Everyday devices (thermostats, wearables, cars) connected and exchanging data online.

Metaverse

Persistent, shared virtual/AR spaces where people interact as digital avatars.

7 DATA SCIENCE, BIG DATA & THE AI HIERARCHY

Big Data — the 4 V's

  • Volume — massive amounts of data
  • Velocity — generated/processed at high speed
  • Variety — structured, text, images, video…
  • Veracity — trustworthiness/quality of the data
Artificial Intelligence — machines performing tasks that need human-like intelligence
Machine Learning — systems that learn patterns from data
Deep Learning — learning with multi-layer neural networks
Generative AI — creates new text, code, images
8 GENERATIVE AI — IN THIS BOOK

What it is

AI models (LLMs) trained on huge text/code corpora that generate new, original content — text, explanations, and code — in response to a prompt.

How this book uses it

  • Generate starter code & explanations while you learn syntax
  • Compare your own solution to an AI-generated one
  • Practice "prompt engineering" — asking clear, specific questions

Cautions

  • AI output can be wrong — always test and verify
  • Understand the code before using it — don't copy blindly
  • Data privacy: don't paste confidential code into public tools
9 DEVELOPMENT TOOLS — COMMAND REFERENCE
CommandPurpose
javac Welcome.javaCompiles source code into bytecode (.class file)
java WelcomeRuns a compiled class through the JVM
java Welcome.javaCompiles & runs a single-file program in one step
jshellOpens Java's interactive REPL to test snippets instantly
javadocGenerates HTML API documentation from source comments
jarPackages compiled classes into a distributable .jar file