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

Week-2.-Java-Programming-Concepts

The document outlines key concepts of Java programming, including syntax, keywords, identifiers, data types, and operators. It also discusses the importance of comments and whitespace for code readability, as well as the concept of concatenation. Additionally, it includes a challenge for creating a dynamic sentence builder program using various data types.

Uploaded by

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

Week-2.-Java-Programming-Concepts

The document outlines key concepts of Java programming, including syntax, keywords, identifiers, data types, and operators. It also discusses the importance of comments and whitespace for code readability, as well as the concept of concatenation. Additionally, it includes a challenge for creating a dynamic sentence builder program using various data types.

Uploaded by

hanslebite
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Meeting with Company A JUNE 15, 2021 - 18H

JULY 11, 2021 - 11H Meeting with Company A


Meeting with Company A JUNE 15, 2021 - 15H
AUGUST 8, 2021 - 16H Meeting with Company A
// MARCH
Meeting with Company23,
A 2021 JUNE 15, 2021 - 15H
RIL 15, 2021 - 15H Meeting with Company A

JAVA
ting with Company A

PROGRAMMING
CONCEPTS
CPE 206L Data Structure and AlgorithmsJUNE 15, 2021 - 18H
Meeting with Company A
ENGR. WENDY E. OLLERO JUNE 15, 2021 - 15H
Instructor Meeting with Company A
JUNE 15, 2021 - 15H
Meeting with Company A
MARCH 22, 2021 - 15H
Kinds of Java Applications

Textual Interface Applets Windows App


Windowing applications
Programs with a textual Applets used in Internet that use a graphical user
interface. browsers. interface.
// JAVA CONCEPTS

Syntax,
Keywords
and
Identifier
// JAVA CONCEPTS

KEYWORDS

● are words that are reserved for


particular purposes.
● They have special meanings and
cannot be changed or used for
other purposes.
● Reserved words
// JAVA CONCEPTS

KEYWORDS
// JAVA CONCEPTS

IDENTIFIER

● are names that programmers


give to classes, methods, and
variables.
// JAVA CONCEPTS

IDENTIFIER

● Names can contain letters, digits and


underscores or dollar signs
● Names must begin with a letter
● Names should start with a lowercase
letter and it cannot contain whitespace
● Names are case sensitive
// JAVA CONCEPTS

IDENTIFIER

● mySum
● num1
● student_no
● a2
// JAVA CONCEPTS

SYNTAX

● refers to the set of rules defining


how a Java program is written and
interpreted.
// JAVA CONCEPTS

SYNTAX

Datatype identifier;
Datatype identifier = Value;

int age;
int age = 23;
// JAVA CONCEPTS

COMMENTS

● can be used to explain Java code, and to


make it more readable.
● It can also be used to prevent execution
when testing alternative code.
// JAVA CONCEPTS

COMMENTS
Single-line comments start with two forward
slashes (//).
// JAVA CONCEPTS

COMMENTS
Multi-line comments start with /* and ends
with */.
// JAVA CONCEPTS

WHITESPACE

● some characters like the space, newlines,


and tabs are considered whitespace
● Together with comments, good
programmers use space, new line, and
indentation to make their program more
readable.
// JAVA CONCEPTS

ESCAPE SEQUENCES
● is a special character sequence that
represents another character.
● Each of these special character
sequences starts with a backslash, which
is followed by another character.
● are used to represent characters that
cannot be used directly in a string
// JAVA CONCEPTS

ESCAPE SEQUENCES
// JAVA CONCEPTS

VARIABLE

● Are used to store up temporary


data to be used in our program’s
runtime.
// JAVA CONCEPTS

VARIABLE
// JAVA CONCEPTS

DATA TYPES

● The type of data inside our variable


// JAVA CONCEPTS

DATA TYPES

● Characters - char (holds a single


character)
● String - String (holds a set of characters)
● Boolean - boolean (holds true or false)
● Integers - int (holds whole numbers)
● Floating Point - float or double (holds
decimal numbers)
// JAVA CONCEPTS

DATA TYPES
// JAVA CONCEPTS

DATA TYPES
Data types are divided into two groups:

● Primitive data types - includes byte,


short, int, long, float, double, boolean and
char
● Non-primitive data types - such as
String, Arrays and Classes (you will learn
more about these in a later chapter)
// JAVA CONCEPTS

DATA TYPES
// JAVA CONCEPTS

EXPRESSION
● is a value, a variable, a method, or one of
their combinations that can be evaluated
to a value.
// JAVA CONCEPTS

STATEMENT
● is any complete sentence that causes
some action to occur.
● A valid Java statement must end with a
semicolon.
JAVA
OPERATORS
JAVA OPERATORS

Operators are used to perform


operations on variables and values.
Java divides the operators into the following groups:
● Arithmetic operators
● Assignment operators
● Comparison operators
● Logical operators
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
// JAVA CONCEPTS

CONCATENATION

The process of joining Strings


together with the plus (+) operator.
// JAVA CONCEPTS

CONCATENATION

“Hello” + “World”
“2” + “3” NOT Concatenation
‘a + “b” 23
2  “3” ‘a’  3
SENTENCE BUILDER CHALLENGE

Create a program that


will only require the
programmer to change
the variable values to
create a dynamic
sentences. It should
have a data types int,
float, string and char.
Meeting with Company A
JUNE 15, 2021 - 15H
Meeting with Company A
JUNE 15, 2021 - 15H
// JAVA CONCEPTS Meeting with Company A
MARCH 22, 2021 - 15H
Meeting with Company A

THANKS!
DO YOU HAVE ANY QUESTIONS?
wendy.ollero@bulsu.edu.ph

CREDITS This presentation template was created by Slidesgo,


including icons by Flaticon, infographics & images by Freepik
JUNE 25, 2021 - 12H
Meeting with Company A JUNE 15, 2021 - 18H
JULY 11, 2021 - 11H Meeting with Company A
Meeting with Company A JUNE 15, 2021 - 15H
AUGUST 8, 2021 - 16H Meeting with Company A

You might also like