Introduction to Programming (Java)
Complete Study Guide — All 13 Chapters
Independent Study Resource
Not affiliated with or endorsed by Yale University
Aligned with the Yale CPSC 1001 syllabus
Edition 2026
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
,Table of Contents
1. Introduction to Programming and Java
2. Variables, Data Types, and Operators
3. Strings and Text Processing
4. Conditionals and Control Flow
5. Loops and Iteration
6. Arrays and ArrayLists
7. Methods and Modular Design
8. Object-Oriented Programming: Classes and Objects
9. Inheritance and Polymorphism
10. Program Analysis, Testing, and Debugging
11. Basic Algorithms: Searching and Sorting
12. Using Libraries: Graphics, Text, and Digital Media
13. Integration and Review
14. Glossary of Key Terms
15. Final Exam Strategy and Study Checklist
16. References and Attribution
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
,Chapter 1 — Introduction to Programming and
Java
Learning Objectives
1. Define programming and its role in problem-solving.
2. Describe the Java compilation and execution process.
3. Write, compile, and run a basic Java program.
4. Understand the structure of a Java class and the main method.
Key Definitions
Term Definition
Program A sequence of instructions that a computer executes.
Source Code Human-readable code written in a programming language.
Compiler A program that translates source code into machine code.
Bytecode Intermediate code produced by the Java compiler; executed by the JVM.
JVM Java Virtual Machine — executes Java bytecode.
Class A blueprint for objects; every Java program is built from classes.
main Method The entry point of a Java application.
1.1 The Java Execution Model
Java source code ( .java ) is compiled by javac into bytecode ( .class ). The JVM executes the
bytecode on any platform, giving Java its "write once, run anywhere" property.
1.2 A First Java Program
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
The class name must match the filename. System.out.println prints a line to the console.
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF
, Yale Connection
CPSC 1001 teaches students majoring in any subject area how to program a computer and solve
problems. No prior programming experience is required.
Practice Questions
1. What is the difference between source code and bytecode?
2. Write a Java program that prints your name.
3. Why must the class name match the filename?
Answer Key
1. Source code is human-readable; bytecode is the compiled intermediate executed by the JVM.
2. public class Name { public static void main(String[] args) {
System.out.println("Your Name"); } }
3. Because the Java compiler expects the public class name to match the .java file name.
Chapter Summary
Concept Summary
Java Model Source → bytecode → JVM execution.
Class Building block of Java programs.
main Entry point of a Java application.
Quick Revision Checklist
☐ Describe the compilation process.
☐ Write a basic Java program.
☐ Identify the main method.
Explore our developer-friendly HTML to PDF API Printed using PDFCrowd HTML to PDF