Unit Big Picture
This unit lays the foundation for all programming in Java. We begin by understanding how a computer executes instructions, then learn to store and manipulate fundamental data using variables and expressions. The unit culminates in learning how to leverage pre-written code by creating and using objects, which are the building blocks of all complex Java applications. By the end of this unit, you will be able to write simple programs that perform calculations and manipulate text data.
Core Threads
Thread 1: Data & Representation
This unit introduces the core ways Java represents information, starting with primitive types (e.g.,
int,double) that hold single, raw values.We then progress to using Objects (like
String), which are complex data types that bundle together data and the behaviors (methods) that act on that data.
Thread 2: Abstraction & APIs
We learn to use powerful, pre-built tools from Java's libraries (like the
Mathclass) without needing to know their internal implementation details.This introduces the concept of an Application Program Interface (API), which defines how we interact with a class by calling its methods.
Key Java Concepts & Data Structures
| Java Concept / Data Structure | What It Is (1-Sentence) | Why It Matters (1-Sentence) |
|---|---|---|
| Primitive Data Types | The most basic data types (int, double, boolean) that store single, simple values. | They are the fundamental building blocks for storing all numerical and logical data in a program. |
| Variable | A named location in memory that stores a value of a specific data type. | Variables allow us to label, store, and manipulate data throughout our program. |
| Expression | A combination of values, variables, and operators that evaluates to a single new value. | Expressions are how we perform calculations and make logical decisions in code. |
| Class | A blueprint or template that defines the properties and behaviors for a type of object. | Classes allow us to model real-world concepts and create our own custom data types. |
| Object | A specific instance of a class, with its own state and access to the class's behaviors. | Objects are the primary actors in Java programs, bundling data and functionality together. |
| Method Call | An instruction that executes a named block of code, often on a specific object. | Method calls allow us to reuse code and interact with objects to perform actions. |
Unit Concept & Syntax Bank
int,double,boolean: The three core primitive types for storing integers, floating-point numbers, and true/false values, respectively.=(Assignment Operator): Stores the value of the expression on the right into the variable on the left (e.g.,int x = 10;).+,-,*,/,%: Arithmetic operators used to perform addition, subtraction, multiplication, division, and find the remainder (modulo).System.out.println(): A method call that prints a value to the console, followed by a new line.new(keyword): The operator used to create, or instantiate, a new object from a class blueprint.String greeting = new String("Hello");.(Dot Operator): The syntax used to access a method belonging to an object or a class (e.g.,greeting.length()orMath.sqrt(9)).Method Signature: The combination of a method's name and its parameter list, which uniquely identifies it (e.g.,
println(String s)).Casting: The explicit conversion of a value from one data type to another, such as
(int) 3.14, which results in the value3.String: A class representing a sequence of characters;Stringobjects are immutable, meaning their contents cannot be changed after creation.
Topic Navigator
| Topic Title | What This Adds (<=10 words) |
|---|---|
| 1.1: Intro to Algorithms, Programming, Compilers | Understanding what a program is and how it runs. |
| 1.2: Variables and Data Types | Storing information using named primitives like int and double. |
| 1.3: Expressions and Output | Performing calculations and displaying results to the user. |
| 1.4: Assignment Statements and Input | Changing variable values and getting user input. |
| 1.5: Casting and Range of Variables | Converting between data types and understanding their limits. |
| 1.6: Compound Assignment Operators | Using shortcuts for common arithmetic assignments (e.g., +=). |
| 1.7: API and Libraries | Discovering pre-written code available for us to use. |
| 1.8: Documentation with Comments | Writing human-readable notes inside our code. |
| 1.9: Method Signatures | Understanding how to identify and use methods correctly. |
| 1.10: Calling Class Methods | Using methods that belong to a class itself (static). |
| 1.11: Math Class | Using static methods for common mathematical functions. |
| 1.12: Objects: Instances of Classes | Defining what an object is: a bundle of data/behavior. |
| 1.13: Object Creation and Storage | Creating new objects in memory using the new keyword. |
| 1.14: Calling Instance Methods | Using methods that belong to a specific object instance. |
| 1.15: String Manipulation | Using the methods of the String class to process text. |
Exam Skills Focus
Code Implementation: Writing statements that declare variables, perform calculations, and call methods on objects.
Code Analysis: Tracing the execution of a program to determine the final value of variables and the output produced.
Application & Design: Selecting the appropriate data types and
MathorStringmethods to solve a given problem.
Common Misconceptions & Clarifications
Integer Division: When dividing two integers, the result is also an integer; any fractional part is truncated. For example,
7 / 2evaluates to3, not3.5.Assignment vs. Equality: The single equals sign (
=) is the assignment operator; it stores a value in a variable. It does not check if two values are equal.Objects vs. Primitives: A primitive (
int,double) holds a simple value directly. An object (String) is a more complex entity that holds a reference (memory address) to its data and has methods you can call using the dot operator.
Summary
This unit transitions you from a computer user to a programmer. You begin by learning the fundamental grammar of Java: how to declare variables to store data, use operators to form expressions, and call methods to perform actions. The focus then shifts from creating simple instructions to using powerful, pre-built tools. By creating and manipulating objects from classes like String and Math, you learn the core object-oriented paradigm of bundling data and behavior, setting the stage for building more complex applications.