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

Java Fundamentals For Android Development

This document discusses Java operators and conditionals. It covers equality and relational operators like ==, !=, >, >=, <, <=. Conditional operators include &&, ||, &, and |. The && and || operators exhibit short-circuiting behavior. The ?: operator acts as a shorthand for if-then-else statements. References for further reading on Java data types, operators, flow control, classes, and methods are also provided.

Uploaded by

RajatKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Java Fundamentals For Android Development

This document discusses Java operators and conditionals. It covers equality and relational operators like ==, !=, >, >=, <, <=. Conditional operators include &&, ||, &, and |. The && and || operators exhibit short-circuiting behavior. The ?: operator acts as a shorthand for if-then-else statements. References for further reading on Java data types, operators, flow control, classes, and methods are also provided.

Uploaded by

RajatKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Java Fundamentals for Android Development

Lesson 1
Java Overview
Operators
Equality and Relational Operators
The equality and relational operators determine
if one operand is greater than, less than, equal
to, or not equal to another operand.

== equal to
!= not equal to
> greater than
>= greater than or equal to
< less than
<= less than or equal to
Conditionals Operators
The && and || operators perform
Conditional-AND and Conditional-OR operations
on two boolean expressions.

These operators exhibit "short-circuiting"


behavior, which means that the second operand
is evaluated only if needed.

&& Conditional-AND
|| Conditional-OR
Conditionals Operators
If you want to evaluate each member of
expression you should use:

& Conditional-AND
| Conditional-OR

You should be carefully because if your logic is


expecting to stop in an validation a
nullPointerException could be reached.
Conditionals Operators
Another conditional operator is ?:,

Is a shorthand for an if-then-else statement.

This operator is also known as the ternary


operator. You have in a single line all
functionality of a if-then-else statement.
References
https://www.tutorialspoint.com/java/java_quick_guide.htm
https://docs.oracle.com/javase/tutorial/java/data/strings.html
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/flowsummary.html
https://docs.oracle.com/javase/tutorial/java/javaOO/classdecl.html
https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

You might also like