0% found this document useful (0 votes)
2 views

LP 1 - Introduction to Java

This lesson plan for Computer Programming 2 at Arellano University outlines the objectives, subject matter, and teaching materials for a blended learning approach. Students will learn about Java technology, its features, and programming fundamentals, culminating in the creation of their first Java program. The plan includes various activities, assessments, and a focus on understanding Java's role in programming and technology.

Uploaded by

Patty Mae Lim
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

LP 1 - Introduction to Java

This lesson plan for Computer Programming 2 at Arellano University outlines the objectives, subject matter, and teaching materials for a blended learning approach. Students will learn about Java technology, its features, and programming fundamentals, culminating in the creation of their first Java program. The plan includes various activities, assessments, and a focus on understanding Java's role in programming and technology.

Uploaded by

Patty Mae Lim
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ARELLANO UNIVERSITY

Jose Abad Santos Campus


Basic Education Department – Senior High School
3058 Taft Avenue Pasay City

Subject: Computer Programming 2

Learning Modality: Blended (Face-to-face/Online)

School: Arellano University – JAS Grade: 11


Campus

Teacher: Pamela Anne D. Gorospe Subject: Computer Programming 2


LESSON PLAN
Date: August 6,8-9, 2024 Semester: First

Time: 9:30-10:30 11 ICT 2 No. of days: 3


10:30-11:50 11 ICT 1

I. Objectives At the end of the lesson, the learners should be able:


 Describe the features of Java Technology
 Know the different phases of a Java Program
 Identify the parts of the Java Program
a. Content Standard The learner demonstrates an understanding of key concepts, underlying,
principles, and core competencies in Programming (Java)

b. Performance Standard The learner shall be able to independently create/provide quality and
marketable products and/ or services in Programming (Java), prescribed by
TESDA Training Regulations.

c. Learning Competencies

d. Most Essential Competencies

II. Subject Matter Introduction to Java Programming Language

III. Teaching Material/s:

A. References:

a. Teacher’s Guide Pages K-11 Module: Computer Programming 2

b. Learner’s Material K11 Module: Basic Animation, Course Outline, Course Syllabus, and
Curriculum guide

c. Textbook Pages Arellano University-SHS K-11 Module Computer Programming 2


Page 2-6

B. Activity List of Learning Resources for pictures, ICT Integration-Multimedia (CANVA App/ Microsoft
Development Engagement Activities PowerPoint Presentation), Google Meet, and LMS

IV: Procedures:

a. Preliminary Activity a. Prayer


b. Checking of Attendance
c. Classroom Management
d. Kumustahan

b. Motivation JUMBLED WORDS: Arrange the given words.


1. AVJA
Answer: JAVA
2. VRTIULA ACHNEIM
Answer: VIRTUAL MACHINE
3. BTEYCDOE
Answer: BYTECODE
4. CASSL OLADRE
Answer: CLASS LOADER
5. OCMPLEIR
Answer: COMPILER
c. Development Discussion: Discussion of Introduction to Java Programming Language
(August 23, 2023)
JAVA BACKGROUND: HISTORY
● James Gosling et al. of Sun Microsystems created it in 1991.
● Initially called Oak, in honor of the tree outside Gosling's window, its
name was changed to Java because there was already a language called
Oak.
● The original motivation for Java is the need for platform independent
language that could be embedded in various consumer electronic
products like toasters and refrigerators. One of the first projects
developed using Java is a personal hand-held remote control named
Star 7.
● At about the same time, the World Wide Web and the Internet were
gaining popularity. Gosling et. al. realized that Java could be used for
Internet programming.

JAVA BACKGROUND: WHAT IS JAVA TECHNOLOGY?


The Java technology is:
● A programming language.
- As a programming language, Java can create all kinds of
applications that you could create using any conventional
programming language.

● A development environment.
- As a development environment, Java technology provides you
with a large suite of tools:
▪ A compiler
▪ An interpreter
▪ A document generator
▪ A class file packaging tool and so on…
JAVA FEATURES

JAVA FEATURES: THE JAVA VIRTUAL MACHINE (JVM)


● Java Virtual Machine (JVM) is an imaginary machine that is
implemented by emulating software on a real machine. It provides the
hardware platform specifications to which you compile all Java
technology code.
● Bytecode is a special machine language that can be understood by the
Java Virtual Machine (JVM). It is independent of any particular
computer hardware, so any computer with a Java interpreter can
execute the compiled Java program, no matter what type of computer
the program was compiled on.

JAVA FEATURES: GARBAGE COLLECTION


● Garbage Collection is responsible for freeing any memory that can be
freed. This happens automatically during the lifetime of the Java
program. Programmers are freed from the burden of having to
deallocate that memory themselves.

JAVA FEATURES: CODE SECURITY


Code security is attained in Java through the implementation of its Java
Runtime Environment (JRE).
● Java Runtime Environment (JRE) runs code compiled for a JVM
and performs class loading (through the class loader), code verification
(through the bytecode verifier) and finally code execution.
● Class Loader is responsible for loading all classes needed for the Java
program. It adds security by separating the namespaces for the classes
of the local file system from those that are imported from network
sources. Lastly, after loading all the classes, the memory layout of the
executable is then determined. This adds protection against
unauthorized access to restricted areas of the code since the memory
layout is determined during runtime.
● Bytecode Verifier tests the format of the code fragments and checks
the code fragments for illegal code that can violate access rights to
objects
Figure 1-1: Phases of a Java Program

Table 1-1: Phases of a Java Program

JAVA COMMENTS, STATEMENTS, AND BLOCKS


COMMENTS are notes written to a code for documentation purposes. These
texts are not part of the program and does not affect the flow of the program.
There are three (3) types of comments in Java: C++ Style Comments, C Style
Comments, and Special Javadoc Comments.

C++ Style Comment starts with // and all the text after this is treated as
comments.
Example: // This is a C++ style or single line comments

C-Style Comments or also called multiline comments starts with a /* and


ends with a */. All text in between the two are treated as comments. Unlike
C++ style comments, it can span multiple lines.
Example: /* this is an example of a C style or multiline comments */

Special Javadoc Comments are used for generating HTML


documentation for your Java programs. You can be created by starting the
line with /** and ending it with */. Like C-style comments, it can also span
lines. Lastly, It can also contain certain tags to add more information to
your comments.
Example: /** This is an example of special java doc comments used for \n
generating an html documentation. It uses tags like: @author JayR Torres
@version 1.2 */

JAVA STATEMENTS is one or more lines of code terminated by a


semicolon.
Example: System.out.println(“Hello world”);

JAVA BLOCKS is one or more statements bounded by an opening and


closing curly braces that groups the statements as one unit. It can be nested
indefinitely and any amount of white space is allowed.
Example:

JAVA STATEMENTS AND BLOCKS CODING GUIDELINES


1. In creating blocks, you can place the opening curly brace in line with
the statement. For example:

2. You should indent the next statements after the start of a block. For
example:

PROGRAM1: FIRST PROGRAM IN JAVA


DESCRIPTION: This program displays the word hello world on screen.

PROGRAM CODES:
DISSECTING THE FIRST PROGRAM
● Line number 1 is the package statement; it tells the package where the
program is located. In this example, program1 is located on the package
Programming2. A package in Java is used to group related
classes/programs, Think of it as a folder in a file directory.
● Line number 2 indicates the name of the class which is Prog1. In Java, all
code should be placed inside a class declaration. The class uses an access
specifier public, which indicates that our class is accessible to other
classes from other packages (packages are a collection of classes).
● Line number 3 - 5 indicates a Java comment (Multi-Line Comment).
● Line number 6 indicates the name of one method in Prog1 which is the
main method. The main method is the starting point of a Java program.
All programs except Applets written in Java start with the main method.
● Line number 7 indicates a comment (Single Line Comment).
● Line number 8 is a statement (System.out.println()) that prints the text
enclosed by quotation on the screen.
● Line number 9 - 10 are closing braces for the main method (Line 6) and
class name (Line 2) respectively.
d. Engagement After the discussion, the student will answer the following questions.
1. What is block?
2. What is a comment?
3. What is a statement?
e. Assimilation Formative Test:
Direction: Using the databank below, identify the following items and write your
answer in the space provided before each item.

1. It performs class loading, code verification, and code execution.


2. It provides the hardware platform specifications on which Java codes are
compiled.
3. It is responsible for freeing any memory that can be freed during the running of a
program.
4. The Java Virtual Machine can understand this special machine language.
5. It is responsible for loading all the classes needed in running a Java program.
6. It verifies the code fragments for illegal codes that violate the access right of an
object.
7. It is the year the Java programming language was created.
8. The device was created on the first project using the Java programming
language.
9. The file contains the Java bytecodes.
10. The file that contains the Java codes.

DATA BANK:

Garbage Collection .java file Class Loader


1992 Java Virtual Machine Remote Control
Bytecode Verifier Byte Code Java Run-time
Environment
Mobile Phone 1991 .class file
f. Valuing As an ICT Student, Why do we need to know about Java Programming
Language?

g. Evaluation Activity: My First Java Program


Direction: Create a Java program (Program 2) that will display your name,
age, gender, and address on the screen.
V. Assignment Advanced study about fundamentals in java

Prepared by: Checked by: Reviewed by:

Ms. Pamela Anne D. Gorospe Ms. Patty Mae R. Lim Mr. Jemel Gary A. Gepiga
Subject Teacher Subject Coordinator Academic Coordinator

Noted by:

Dr. Archieval A. Rodriguez


SHS Principal

You might also like