AP Computer Science A · Unit 1: Using Objects & Methods
1.1 Why Programming? Why Java?
Why we program
Programming lets us give a computer precise instructions to solve problems, automate tasks, and process data. A computer follows instructions written in a programming language exactly as written — it has no common sense, so precision and clear logic are essential when writing code.
What is Java?
Java is an object-oriented programming language used throughout AP CSA. It organizes code into classes and objects that model real-world things with attributes (data) and behaviors (methods). Java code is compiled into bytecode, which runs on the Java Virtual Machine (JVM), making it portable across different systems.
Programs, algorithms, and abstraction
A program is a set of instructions executed to perform a task, often built from smaller algorithms — step-by-step procedures for solving a problem. Abstraction hides implementation details behind a simple interface, letting programmers use existing code (like Java's built-in classes) without knowing exactly how it works internally.
Key terms
- Programming
- The process of writing precise instructions for a computer to perform a task.
- Java
- An object-oriented programming language used in AP CSA, known for portability via the JVM.
- Java Virtual Machine (JVM)
- A program that runs compiled Java bytecode, allowing Java programs to run on any platform.
- Algorithm
- A step-by-step procedure or set of instructions for solving a problem.
- Abstraction
- Hiding complex implementation details behind a simple, usable interface.
Try an AP-style question
What does the Java compiler produce from source code?
- Bytecode that runs on the JVM
- An HTML page for a browser
- A spreadsheet of results
- Machine code for one specific CPU
Show the answer
A. Platform independence.
Practice 8 AP-style questions with instant explanations, flashcards and spaced review.
Study 1.1 free in APrep