尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
TUNASAN NATIONAL HIGH SCHOOL
SDO - Muntinlupa City
ROWELL L. MARQUINA
Senior High School Teacher
TUNASAN NATIONAL HIGH SCHOOL
Lesson 3 - Java Programming
LEARNING OBJECTIVES:
At the end of the session, you will be able to:
1. differentiate print and println from
one another;
2. display text on screen using print and
println;
3. discuss what is a comment in Java
and what it is used in a program; and
4. demonstrate how to display
comments on a Java program;
One of the most basic competencies in Java
programming is how to instruct the program to
display text on the screen.
Java offers two ways of displaying text output on the
screen using the print, and println methods.
DISPLAYING TEXT ON SCREEN
The print method refers to the Java statement that
instructs the program to display text in a single line.
PRINT vs PRINTLN METHOD
The println method on the other hand is used to
display text in separate lines.
PRINT vs PRINTLN METHOD
As we have discussed earlier, the print method is used
to display text in a single line.
Even if you code the lines separately using print
method, the texts will still appear in a single line.
PRINT vs PRINTLN METHOD
The println method on the other hand is used to
display text in separate lines.
What happens in the code is that
after the first line of text is
displayed it will bring the cursor to
the next line before displaying the
second line of text and so forth.
System.out refers to the Java object that details where it will
display the output of the program.
ANATOMY OF THE PRINT METHOD
print refers to the method that instructs the program to
display the text in a single line.
(“Have a wonderful day!”) is the text that will be displayed
on the screen.
; is referred to as a separator which signifies the end
of the line code.
PRACTICE TEST 1:
Create a simple program which
will display the numbers 1-5 in a
single line. Each number must be
displayed using individual print
methods.
PRACTICE TEST 2:
Using println, create a simple
program which will display the
following information:
▪ Name
▪ Date of Birth
▪ Name of Father
▪ Name of Mother
PRACTICE TEST 3:
On a piece of paper, write the
expected output of the source
code below:
WHAT ARE COMMENTS?
Comments are non-executable Java statements that
are used by programmers to place notes, descriptions,
or explanations on their program.
It is also referred to as inline documentation because
it is used to document and provide explanations
about specific parts of the program.
This is an example of a comment in Java.
WHAT ARE COMMENTS?
Since comments are non-executable statements,
they do not have any effect on the program.
SINGLE-LINE COMMENTS
There are two ways of writing comments in Java. The
one you are seeing below is called a single-line
comment which is used for writing short narrative or
explanations in a program. It is characterized by two
forward slashes ( // ) at the beginning of the
comment.
This is a single-line comment in Java.
MULTI-LINE COMMENTS
The other method is by writing a multi-line comment
which is for writing complex and details
documentations on the program. It is a block
statements that starts with forward slash then asterisk
(/*) and ends with a (*/) asterisk and forward slash.
This is a multi-line comment in Java.
PRACTICE TEST 4:
Using println, create a simple program
which will display the required
information below. Include comments
that tells something about the
information you have provided.
▪ Nickname
▪ Childhood Hero
▪ Favorite Color
▪ Dream Profession
DISPLAYING TEXT ON SCREEN
AND WRITING COMMENTS
MR. ROWELL L. MARQUINA
Tunasan National High School
Senior High School Department
Email Address:
rowell.marquina001@deped.gov.ph
sirrowellmarquina@gmail.com
rmarquina@mitis.edu.ph

More Related Content

What's hot

python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
kamal kotecha
 
Publishing and delivery of mobile application
Publishing and delivery of mobile applicationPublishing and delivery of mobile application
Publishing and delivery of mobile application
K Senthil Kumar
 
Java I/O
Java I/OJava I/O
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
Vasim Pathan
 
Plsql
PlsqlPlsql
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
Vineet Kumar Saini
 
FORMAT ATP 2022-KONSENTRASI KEAHLIAN.doc
FORMAT ATP 2022-KONSENTRASI KEAHLIAN.docFORMAT ATP 2022-KONSENTRASI KEAHLIAN.doc
FORMAT ATP 2022-KONSENTRASI KEAHLIAN.doc
AhmadWildanListyanto
 
Java pdf
Java   pdfJava   pdf
City search documentation
City search documentationCity search documentation
City search documentation
Rajesh Varanasi
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
Temesgen Molla
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
Damian T. Gordon
 
Installation of java and program execution
Installation of java and program executionInstallation of java and program execution
Installation of java and program execution
Rakhee Chhibber
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
vikram mahendra
 
Features of JAVA Programming Language.
Features of JAVA Programming Language.Features of JAVA Programming Language.
Features of JAVA Programming Language.
Bhautik Jethva
 
JVM
JVMJVM
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
Asha Sari
 
Storage classes
Storage classesStorage classes
Storage classes
UTTAM VERMA
 
Steganography
SteganographySteganography
Steganography
Josh Kumar
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
Hamid Ghorbani
 

What's hot (20)

python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
Publishing and delivery of mobile application
Publishing and delivery of mobile applicationPublishing and delivery of mobile application
Publishing and delivery of mobile application
 
Java I/O
Java I/OJava I/O
Java I/O
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
 
Plsql
PlsqlPlsql
Plsql
 
Operators in PHP
Operators in PHPOperators in PHP
Operators in PHP
 
FORMAT ATP 2022-KONSENTRASI KEAHLIAN.doc
FORMAT ATP 2022-KONSENTRASI KEAHLIAN.docFORMAT ATP 2022-KONSENTRASI KEAHLIAN.doc
FORMAT ATP 2022-KONSENTRASI KEAHLIAN.doc
 
Java pdf
Java   pdfJava   pdf
Java pdf
 
City search documentation
City search documentationCity search documentation
City search documentation
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
Installation of java and program execution
Installation of java and program executionInstallation of java and program execution
Installation of java and program execution
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
 
Features of JAVA Programming Language.
Features of JAVA Programming Language.Features of JAVA Programming Language.
Features of JAVA Programming Language.
 
JVM
JVMJVM
JVM
 
The pseudocode
The pseudocodeThe pseudocode
The pseudocode
 
Storage classes
Storage classesStorage classes
Storage classes
 
Steganography
SteganographySteganography
Steganography
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
 

Similar to Lesson 3 - Displaying Text on Screen.pdf

(Ebook pdf) java programming language basics
(Ebook pdf)   java programming language basics(Ebook pdf)   java programming language basics
(Ebook pdf) java programming language basics
Raffaella D'angelo
 
Intro to programing with java-lecture 1
Intro to programing with java-lecture 1Intro to programing with java-lecture 1
Intro to programing with java-lecture 1
Mohamed Essam
 
AndroidHTP3_AppA.pptx
AndroidHTP3_AppA.pptxAndroidHTP3_AppA.pptx
AndroidHTP3_AppA.pptx
MattMarino13
 
Java programming language basics
Java programming language basicsJava programming language basics
Java programming language basics
dharmendra kumar dhakar
 
Programming 1.pptx
Programming 1.pptxProgramming 1.pptx
Programming 1.pptx
ardrenful
 
Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdfSulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
SULTHAN BASHA
 
Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manual
nahalomar
 
10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz
Shahbaz Ahmad
 
02장 Introduction to Java Applications
02장 Introduction to Java Applications02장 Introduction to Java Applications
02장 Introduction to Java Applications
유석 남
 
lecture 6
 lecture 6 lecture 6
lecture 6
umardanjumamaiwada
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
umardanjumamaiwada
 
Simple
SimpleSimple
Basics of java 1
Basics of java 1Basics of java 1
Basics of java 1
Vijay Kankane
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATION
Ajit Yadav
 
Computer
ComputerComputer
Computer
leeparkkim
 
Solutions manual for absolute java 5th edition by walter savitch
Solutions manual for absolute java 5th edition by walter savitchSolutions manual for absolute java 5th edition by walter savitch
Solutions manual for absolute java 5th edition by walter savitch
Albern9271
 
1. Introduction Original - To Print
1. Introduction Original - To Print1. Introduction Original - To Print
1. Introduction Original - To Print
Chinthaka Fernando
 
java training in chandigarh
java training in chandigarh java training in chandigarh
java training in chandigarh
Excellence Academy
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
MayaTofik
 
Lesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptxLesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptx
Neil Mutia
 

Similar to Lesson 3 - Displaying Text on Screen.pdf (20)

(Ebook pdf) java programming language basics
(Ebook pdf)   java programming language basics(Ebook pdf)   java programming language basics
(Ebook pdf) java programming language basics
 
Intro to programing with java-lecture 1
Intro to programing with java-lecture 1Intro to programing with java-lecture 1
Intro to programing with java-lecture 1
 
AndroidHTP3_AppA.pptx
AndroidHTP3_AppA.pptxAndroidHTP3_AppA.pptx
AndroidHTP3_AppA.pptx
 
Java programming language basics
Java programming language basicsJava programming language basics
Java programming language basics
 
Programming 1.pptx
Programming 1.pptxProgramming 1.pptx
Programming 1.pptx
 
Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdfSulthan's_JAVA_Material_for_B.Sc-CS.pdf
Sulthan's_JAVA_Material_for_B.Sc-CS.pdf
 
Java lab1 manual
Java lab1 manualJava lab1 manual
Java lab1 manual
 
10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz
 
02장 Introduction to Java Applications
02장 Introduction to Java Applications02장 Introduction to Java Applications
02장 Introduction to Java Applications
 
lecture 6
 lecture 6 lecture 6
lecture 6
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
Simple
SimpleSimple
Simple
 
Basics of java 1
Basics of java 1Basics of java 1
Basics of java 1
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATION
 
Computer
ComputerComputer
Computer
 
Solutions manual for absolute java 5th edition by walter savitch
Solutions manual for absolute java 5th edition by walter savitchSolutions manual for absolute java 5th edition by walter savitch
Solutions manual for absolute java 5th edition by walter savitch
 
1. Introduction Original - To Print
1. Introduction Original - To Print1. Introduction Original - To Print
1. Introduction Original - To Print
 
java training in chandigarh
java training in chandigarh java training in chandigarh
java training in chandigarh
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
 
Lesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptxLesson 1 - Introduction to Computer Programming.pptx
Lesson 1 - Introduction to Computer Programming.pptx
 

More from ROWELL MARQUINA

QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
ROWELL MARQUINA
 
QMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxQMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptx
ROWELL MARQUINA
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfHCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
ROWELL MARQUINA
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
ROWELL MARQUINA
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
ROWELL MARQUINA
 
ITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdfITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdf
ROWELL MARQUINA
 
ITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdfITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdf
ROWELL MARQUINA
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ROWELL MARQUINA
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ROWELL MARQUINA
 
CHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdf
ROWELL MARQUINA
 
Animation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdfAnimation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdf
ROWELL MARQUINA
 
DSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdfDSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdf
ROWELL MARQUINA
 
Lesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdfLesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdf
ROWELL MARQUINA
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdf
ROWELL MARQUINA
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
ROWELL MARQUINA
 
Animation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdfAnimation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdf
ROWELL MARQUINA
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
ROWELL MARQUINA
 
Personal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdfPersonal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdf
ROWELL MARQUINA
 
Environment and Market.pdf
Environment and Market.pdfEnvironment and Market.pdf
Environment and Market.pdf
ROWELL MARQUINA
 

More from ROWELL MARQUINA (19)

QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
QMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxQMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptx
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfHCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
 
ITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdfITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdf
 
ITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdfITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdf
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
 
CHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdf
 
Animation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdfAnimation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdf
 
DSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdfDSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdf
 
Lesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdfLesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdf
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdf
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
 
Animation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdfAnimation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdf
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
 
Personal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdfPersonal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdf
 
Environment and Market.pdf
Environment and Market.pdfEnvironment and Market.pdf
Environment and Market.pdf
 

Recently uploaded

Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptxScience-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Catherine Dela Cruz
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
EducationNC
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
Friends of African Village Libraries
 
(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"
MJDuyan
 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
MattVassar1
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
Decolonizing Universal Design for Learning
Decolonizing Universal Design for LearningDecolonizing Universal Design for Learning
Decolonizing Universal Design for Learning
Frederic Fovet
 
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
nabaegha
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
Celine George
 
Cross-Cultural Leadership and Communication
Cross-Cultural Leadership and CommunicationCross-Cultural Leadership and Communication
Cross-Cultural Leadership and Communication
MattVassar1
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Slides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptxSlides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptx
shabeluno
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
Infosec
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
Kalna College
 
The basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptxThe basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptx
heathfieldcps1
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
roshanranjit222
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
pol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdfpol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdf
BiplabHalder13
 

Recently uploaded (20)

Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptxScience-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
 
Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
 
(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"
 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
Decolonizing Universal Design for Learning
Decolonizing Universal Design for LearningDecolonizing Universal Design for Learning
Decolonizing Universal Design for Learning
 
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
 
managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
 
Cross-Cultural Leadership and Communication
Cross-Cultural Leadership and CommunicationCross-Cultural Leadership and Communication
Cross-Cultural Leadership and Communication
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Slides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptxSlides Peluncuran Amalan Pemakanan Sihat.pptx
Slides Peluncuran Amalan Pemakanan Sihat.pptx
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
 
220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx220711130088 Sumi Basak Virtual University EPC 3.pptx
220711130088 Sumi Basak Virtual University EPC 3.pptx
 
The basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptxThe basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptx
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
pol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdfpol sci Election and Representation Class 11 Notes.pdf
pol sci Election and Representation Class 11 Notes.pdf
 

Lesson 3 - Displaying Text on Screen.pdf

  • 1. TUNASAN NATIONAL HIGH SCHOOL SDO - Muntinlupa City ROWELL L. MARQUINA Senior High School Teacher TUNASAN NATIONAL HIGH SCHOOL Lesson 3 - Java Programming
  • 2. LEARNING OBJECTIVES: At the end of the session, you will be able to: 1. differentiate print and println from one another; 2. display text on screen using print and println; 3. discuss what is a comment in Java and what it is used in a program; and 4. demonstrate how to display comments on a Java program;
  • 3.
  • 4. One of the most basic competencies in Java programming is how to instruct the program to display text on the screen. Java offers two ways of displaying text output on the screen using the print, and println methods. DISPLAYING TEXT ON SCREEN
  • 5. The print method refers to the Java statement that instructs the program to display text in a single line. PRINT vs PRINTLN METHOD The println method on the other hand is used to display text in separate lines.
  • 6. PRINT vs PRINTLN METHOD As we have discussed earlier, the print method is used to display text in a single line. Even if you code the lines separately using print method, the texts will still appear in a single line.
  • 7. PRINT vs PRINTLN METHOD The println method on the other hand is used to display text in separate lines. What happens in the code is that after the first line of text is displayed it will bring the cursor to the next line before displaying the second line of text and so forth.
  • 8. System.out refers to the Java object that details where it will display the output of the program. ANATOMY OF THE PRINT METHOD print refers to the method that instructs the program to display the text in a single line. (“Have a wonderful day!”) is the text that will be displayed on the screen. ; is referred to as a separator which signifies the end of the line code.
  • 9. PRACTICE TEST 1: Create a simple program which will display the numbers 1-5 in a single line. Each number must be displayed using individual print methods.
  • 10. PRACTICE TEST 2: Using println, create a simple program which will display the following information: ▪ Name ▪ Date of Birth ▪ Name of Father ▪ Name of Mother
  • 11. PRACTICE TEST 3: On a piece of paper, write the expected output of the source code below:
  • 12.
  • 13. WHAT ARE COMMENTS? Comments are non-executable Java statements that are used by programmers to place notes, descriptions, or explanations on their program. It is also referred to as inline documentation because it is used to document and provide explanations about specific parts of the program. This is an example of a comment in Java.
  • 14. WHAT ARE COMMENTS? Since comments are non-executable statements, they do not have any effect on the program.
  • 15. SINGLE-LINE COMMENTS There are two ways of writing comments in Java. The one you are seeing below is called a single-line comment which is used for writing short narrative or explanations in a program. It is characterized by two forward slashes ( // ) at the beginning of the comment. This is a single-line comment in Java.
  • 16. MULTI-LINE COMMENTS The other method is by writing a multi-line comment which is for writing complex and details documentations on the program. It is a block statements that starts with forward slash then asterisk (/*) and ends with a (*/) asterisk and forward slash. This is a multi-line comment in Java.
  • 17. PRACTICE TEST 4: Using println, create a simple program which will display the required information below. Include comments that tells something about the information you have provided. ▪ Nickname ▪ Childhood Hero ▪ Favorite Color ▪ Dream Profession
  • 18. DISPLAYING TEXT ON SCREEN AND WRITING COMMENTS MR. ROWELL L. MARQUINA Tunasan National High School Senior High School Department Email Address: rowell.marquina001@deped.gov.ph sirrowellmarquina@gmail.com rmarquina@mitis.edu.ph
  翻译: