Professional Documents
Culture Documents
2nd Quart Lesson 1
2nd Quart Lesson 1
2nd Quart Lesson 1
Sun Microsystems released the Java programming language in 1995. Java is known for being simple,
portable, secure, and robust. Though it was released over twenty years ago, Java remains one of the
most popular programming languages today.
One reason people love Java is the Java Virtual Machine, which ensures the same Java code can
be run on different operating systems and platforms. Sun Microsystems’ slogan for Java was “write
once, run everywhere”.
Programming languages
are composed of syntax, the specific
instructions which Java understands. We
write syntax in files to create programs,
which are executed by the computer to
perform the desired task.
It is used for:
Second Quarter Module for Grade 9 Prepared by Mr. John Allan Clave
Mrs. Celine Anne Dormiendo
Pasig Catholic College PCC @ 108: “Bringing the Good News to All Faith
Junior High School All Seasons Amidst Challenging Times”
SY 2020 – 2021
________________________________________________________________________________________________________________
The way Java works
Features of Java
Second Quarter Module for Grade 9 Prepared by Mr. John Allan Clave
Mrs. Celine Anne Dormiendo
Pasig Catholic College PCC @ 108: “Bringing the Good News to All Faith
Junior High School All Seasons Amidst Challenging Times”
SY 2020 – 2021
________________________________________________________________________________________________________________
LECTURE
To create a simple java program, you need to create a class that contains the main method.
• Comments are statements that are not executed by the compiler and interpreter. The
comments can be used to provide information or explanation about the variable, method,
class or any statement. It can also be used to hide program code for specific time.
• HelloJava is the Class name of the program above. Every line of code that runs in Java must
be inside a class. In our example, we named the class HelloJava. A class should always start
with an uppercase first letter. The name of the java file must match the class name. When
saving the file, save it using the class name and add ".java" to the end of the filename.
• The main()method is required and you will see it in every Java program:
Any code inside the main() method will be executed. Every Java program has a class name
which must match the filename, and that every program must contain the main() method.
• The second line of the program consists of the left brace, which is matched with the second
right brace (the very last brace). These braces together mark the beginning and end of (the
body of) the class HelloJava.
Second Quarter Module for Grade 9 Prepared by Mr. John Allan Clave
Mrs. Celine Anne Dormiendo
Pasig Catholic College PCC @ 108: “Bringing the Good News to All Faith
Junior High School All Seasons Amidst Challenging Times”
SY 2020 – 2021
________________________________________________________________________________________________________________
Note: The curly braces { } marks the beginning and the end of a block of code.
Note: Each code statement must end with a semicolon.
Java Terminologies:
PROGRAM
Second Quarter Module for Grade 9 Prepared by Mr. John Allan Clave
Mrs. Celine Anne Dormiendo