Course overview
Java Programming introduces learners to designing, coding, testing, debugging, and documenting computer programs. Java is a general-purpose, object-oriented language used in many kinds of software development.
Learning goals
Understand core syntax, use problem-solving steps, apply object-oriented concepts, and build a small working application.
Skills to practise
Algorithm design, coding, debugging, collaboration, testing, and explaining program decisions.
Learning approach
Read a concept, inspect an example, modify the code, test it, and reflect on the result.
This page is a learning companion, not a replacement for the official curriculum guide, school learning plan, or teacher’s instructions.
Learning path
Work through these eight learning blocks in sequence. Mark each one complete after you can explain the key idea and finish its practice task.
01 · Programming foundations
Algorithms, pseudocode, flowcharts, and problem decomposition.
02 · Java setup & structure
JDK, source files, main method, compiling, and running.
03 · Data & operators
Variables, data types, expressions, and conversions.
04 · Decisions & loops
Conditions, branching, iteration, and tracing.
05 · Methods & arrays
Reusable methods, parameters, return values, and collections of values.
06 · Object-oriented Java
Classes, objects, encapsulation, inheritance, and polymorphism.
07 · Build & test
Plan, implement, test, debug, document, and improve an application.
08 · Project & reflection
Present a working project and reflect on learning and teamwork.
Java foundations
1. From a problem to an algorithm
An algorithm is a clear sequence of steps for solving a problem. Before coding, identify inputs, processing, and outputs.
Information the program receives.
Rules or calculations applied to the input.
The result shown or saved.
Try it: Write steps to calculate the average of three quiz scores. Identify the inputs, formula, and output.
2. Java program structure
A Java source file commonly contains a class. Execution in a simple console program begins in the main method.
// HelloGrade12.java
public class HelloGrade12 {
public static void main(String[] args) {
System.out.println("Hello, Grade 12!");
}
}Save as HelloGrade12.java when the public class is named HelloGrade12. Compile and run using your classroom’s selected Java environment.
3. Variables, data types, and operators
A variable names a value that a program can use. Java is statically typed: declarations specify the kind of value.
int age = 17; double average = 89.5; char section = 'A'; boolean submitted = true; String studentName = "Alex"; int total = 80 + 90 + 85; double mean = total / 3.0;
Common types include int, double, char, boolean, and the reference type String. Operators include arithmetic (+ - * / %), comparison (== != < > <= >=), and logical (&& || !).
3.0 or convert appropriately when calculating decimal averages.4. Decisions and repetition
Use if/else to choose between paths and loops to repeat work.
int score = 86;
if (score >= 75) {
System.out.println("Passed");
} else {
System.out.println("Needs more practice");
}
for (int i = 1; i <= 5; i++) {
System.out.println(i);
}Trace the condition carefully. For loops, identify initialization, continuation condition, and update to avoid accidental infinite loops.
5. Methods and arrays
A method packages a task into a reusable unit. Parameters receive input; a return value sends a result back.
static double average(double a, double b, double c) {
return (a + b + c) / 3.0;
}
public static void main(String[] args) {
double result = average(80, 90, 85);
System.out.println(result);
}An array stores a fixed-size sequence of values of one declared element type. Array indexes begin at zero.
int[] scores = {80, 90, 85};
System.out.println(scores[0]); // 80Object-oriented programming (OOP)
Object-oriented programming organizes software around objects that combine state (data) and behaviour (methods).
🏗️ Class
A blueprint describing fields and methods.
📦 Object
An instance created from a class.
🔒 Encapsulation
Protect internal state and expose appropriate operations.
🌱 Inheritance
Define a class based on another class where appropriate.
🎭 Polymorphism
Use a shared interface or parent type with different implementations.
🧠 Abstraction
Focus on essential behaviour while hiding implementation details.
class Student {
private String name;
private int gradeLevel;
Student(String name, int gradeLevel) {
this.name = name;
this.gradeLevel = gradeLevel;
}
public String getName() {
return name;
}
}
Student learner = new Student("Alex", 12);
System.out.println(learner.getName());
private instead of directly accessible? How could a class validate data before changing it?Developing a Java application
A practical development cycle
Clarify the user, problem, inputs, outputs, and constraints.
Sketch algorithms, screen flow, data, and class responsibilities.
Write readable code using meaningful names and consistent formatting.
Try normal, boundary, and invalid inputs; compare actual and expected results.
Reproduce errors, inspect evidence, isolate the cause, and retest.
Explain how to run the program, its features, limits, and team contributions.
Suggested project: Student Score Tracker
Create a small application that accepts student names and scores, calculates an average, and reports a result according to the teacher’s stated criteria. Add input validation and a clear user interface.
Project planning checklist
- Define the intended users and the problem being solved.
- List required inputs, outputs, and validation rules.
- Plan classes or methods before coding.
- Divide tasks fairly and record contributions.
- Test valid, boundary, and invalid cases.
- Prepare a short demonstration and reflection.
Practice activities
Activity A — Predict the output
int x = 7; int y = 2; System.out.println(x / y); System.out.println(x % y);
Write both outputs before running the program. Explain the difference between division and remainder.
Activity B — Improve the code
double a = 80; double b = 90; double c = 85; double average = (a + b + c) / 3; System.out.println(average);
Modify this code so it uses a reusable method and accepts different values. Consider how to handle invalid scores.
Activity C — Design an algorithm
Write pseudocode for a program that asks for five numbers and displays the largest. Then draw a flowchart or explain each decision and repetition step.
Knowledge check
Choose one answer for each question, then select Check answers. This quiz is for practice and does not submit or store grades.
Java glossary
A finite, ordered set of steps for solving a problem.
A tool that translates source code into another form, such as Java bytecode.
Finding, understanding, and correcting program defects.
A named storage location associated with a value and type.
A named block of code that performs an operation.
A named input declared by a method.
A fixed-length indexed sequence of values of one element type.
A declaration that defines a type, often with fields and methods.
A runtime instance of a class.
An integrated development environment for editing, running, and debugging code.
Java Development Kit: tools used to develop Java programs.
Inputs and conditions with an expected result used to check behaviour.
References & curriculum resources
Use the official documents and Java documentation below to verify curriculum details and deepen your learning.
- Department of Education (DepEd). Programming (Java) NC III Curriculum Guide (legacy K–12 guide, 2016; 320 hours). Open official PDF.
- DepEd Learning Portal. Grade 12 Programming (Java) learning resource. Open Grade 12 resource.
- DepEd. Strengthened Senior High School Curriculum: Computer Programming (Java), Grade 11/12. Open curriculum guide.
- DepEd. DepEd Memorandum No. 012, s. 2026 — implementation guidance for the Strengthened SHS curriculum. Open memorandum.
- DepEd. Strengthened Senior High School Program. Open program page.
- Oracle. Java Documentation. Open Java documentation.
- Oracle. The Java Tutorials. Open tutorials.
- Oracle. The Java Language Specification. Open language specifications.