Journey to Java: Episode 5 “Control Flow”

Switch

int value = 1;switch(value) {
case 1:
System,out.println("value was 1");
break;
}

For

for(init; termination; increment) {}
for(int i = 0; i < 5; i++) {
System.out.println("i = " + i);
}

While

int count = 0;
while(count != 5) {
System.out.println("count is " + count);
count++;
}

Do While

int count = 0;
do {
System.out.println(count);
count++;
} while (count != 5);

--

--

--

Student at The Flatiron School in Washington DC

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

Recommended from Medium

Cross Validation in Python

An Aspiring Dr Hackathon

Getting Started with Podman

Power of .xcconfigs in Xcode

Week 10 on the BT Digital Intensive!

Using Object-Oriented Principles in Test Code

Building a basic covid-19 data pipeline with airflow and python

Configure SSH service with basic security configuration and MotD message.

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

Journey of DLithe Bootcamp Java Full Stack Developer | Week 1(Mar 21-Mar 26)

Journey of DLithe Bootcamp JAVA Full Stack Developer||SpringBoot(April25-May2)

Linux Commands

Journey of DLithe Bootcamp Java Full Stack Developer(April 18 -April24)