Journey to Java: Episode 3 “Operators, Expressions, and Conditionals”

3 + 7;
// 3 and 7 are operands
// + is the operator
3 + 7 is the expression
boolean isOverTwentyOne = true;if (isOverTwentyOne == true){
System.out.println("over twenty one");
}
// checking to see if isOverTwentyOne is true then performing a task if it is.
int high = 70;
int low = 20;
int testNum = 55;
if (testNum > low && testNum < high) {
System.out.println("test number is in the middle");
}
char a = "A";
char b = "B";
char newGrade = "A";
if (NewGrade == a || newGrade == b) {
System.out.println("this is a good grade");
}
boolean happy = true;if (happy){
System.out.println("you are happy");
{
if (!happy){
System.out.println("you are not happy");
}
boolean isInvited = trueisInvited ? System.out.println("invited") : System.out.println("not invited");
public class Practice {   public static void main(String[] args) {      //conditional test      double twenty = 20.00;      double eighty = 80.00;      double solution = (twenty + eighty) * 100.00 % 40.00;      boolean divisable = (solution == 0) ? true : false;
if (!divisable) { System.out.println("got some remainder"); } }}

--

--

--

Student at The Flatiron School in Washington DC

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Real-Time Sudoku Solver

Figure 1: Unsolved Sudoku grid (9*9)

Serverless And Startups: Remodeling The Startups Landscape

[DMWN #36] Fortune shares tips that helped him get his first full-time Job ✨

Writing Clean Code — Part 6

A hands-on guide on how to set up a Jenkins server with Nexus, Sonarqube and AD integration

Provisioning Vagrant multi-machines with Ansible

What is Capital-as-a-Service?

My fifith week of GSOD with OpenMRS

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Adolfo

Adam Adolfo

Student at The Flatiron School in Washington DC

More from Medium

JAVA JDBC

JAVA VIRTUAL MACHINE

Annotation in Java..!

JAVA Annotations