Junior and Senior High School • Interactive Learning Guide

Don Vicente Rama Memorial National High School
Macupa Street, Basak, Cebu City

Java Programming

Explore programming concepts step by step, practise reading and writing Java, check your understanding, and track your learning progress.

0 of 8 lessons completed
Start here

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.

Curriculum alignment note: DepEd has published both a legacy K–12 ICT Programming (Java) NC III curriculum guide and a Strengthened Senior High School Computer Programming (Java) guide. Schools should follow the guide and implementation arrangements applicable to their cohort and school.

This page is a learning companion, not a replacement for the official curriculum guide, school learning plan, or teacher’s instructions.

Course map

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.

Modules 1–5

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.

Input

Information the program receives.

Process

Rules or calculations applied to the input.

Output

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 (&& || !).

Watch out: Integer division discards the fractional part. Use 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]); // 80
Module 6

Object-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());
Think about it: Why might a field be private instead of directly accessible? How could a class validate data before changing it?
Modules 7–8

Developing a Java application

A practical development cycle

1. Analyse

Clarify the user, problem, inputs, outputs, and constraints.

2. Design

Sketch algorithms, screen flow, data, and class responsibilities.

3. Implement

Write readable code using meaningful names and consistent formatting.

4. Test

Try normal, boundary, and invalid inputs; compare actual and expected results.

5. Debug

Reproduce errors, inspect evidence, isolate the cause, and retest.

6. Document & present

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.
Hands-on practice

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.

Self-check

Knowledge check

Choose one answer for each question, then select Check answers. This quiz is for practice and does not submit or store grades.

1. Which method is the usual entry point of a simple Java console application?

2. Which type is commonly used for a decimal number such as 92.5?

3. What is the first valid index of a Java array?

4. Which OOP concept helps restrict direct access to an object's internal state?

5. Which testing practice is useful for checking input validation?

Quick reference

Java glossary

Algorithm
A finite, ordered set of steps for solving a problem.
Compiler
A tool that translates source code into another form, such as Java bytecode.
Debugging
Finding, understanding, and correcting program defects.
Variable
A named storage location associated with a value and type.
Method
A named block of code that performs an operation.
Parameter
A named input declared by a method.
Array
A fixed-length indexed sequence of values of one element type.
Class
A declaration that defines a type, often with fields and methods.
Object
A runtime instance of a class.
IDE
An integrated development environment for editing, running, and debugging code.
JDK
Java Development Kit: tools used to develop Java programs.
Test case
Inputs and conditions with an expected result used to check behaviour.
Further reading

References & curriculum resources

Use the official documents and Java documentation below to verify curriculum details and deepen your learning.

  1. Department of Education (DepEd). Programming (Java) NC III Curriculum Guide (legacy K–12 guide, 2016; 320 hours). Open official PDF.
  2. DepEd Learning Portal. Grade 12 Programming (Java) learning resource. Open Grade 12 resource.
  3. DepEd. Strengthened Senior High School Curriculum: Computer Programming (Java), Grade 11/12. Open curriculum guide.
  4. DepEd. DepEd Memorandum No. 012, s. 2026 — implementation guidance for the Strengthened SHS curriculum. Open memorandum.
  5. DepEd. Strengthened Senior High School Program. Open program page.
  6. Oracle. Java Documentation. Open Java documentation.
  7. Oracle. The Java Tutorials. Open tutorials.
  8. Oracle. The Java Language Specification. Open language specifications.
Teacher note: Curriculum documents can be revised. Confirm the current guide, competency sequence, time allotment, and school implementation with your department or official DepEd announcements.