Functions

Loops

IntelliJ and Debugging

Welcome to the Nanodegree program

Welcome to the Nanodegree program

Help

Career Service

Java Refresher Course

Introduction to the Spring Boot framework

Learn the fundamentals of Java while being introduced to a Spring Boot framework and associated integrations and plugins.

Spring Boot template engine

Spring Boot – continued

Create a Chat Room Application with Spring Boot

Overview

Explore the differences between web services, APIs and microservices. Develop REST and GraphQL APIs, and learn how to secure, consume, document and test those APIs and web services.

REST APIs

GraphQL APIs

Microservices

Security

Consuming SOAP & REST

Documentation

Unit & Integration Tests

Project Build the Backend System for a Car Website

RDBMS & JDBC

Build applications that read and write to relational databases using both the Java Persistence API (JPA) and SQL. Use standard design patterns to make your persistence layer easy to test and integrate with a Spring Boot application.

Java Persistence API

NoSQL and MongoDB

MongoDB for Java

Midterm Customer Reviews API

Final – Customer Reviews API

Authentication and Authorization

Learn about Git, version control and best practices for authorization and authentication. Use Jenkins to build a CI/CD pipeline to deploy code to production.

Testing

Logging

Splunk

CICD

Project

23. switch Statement

Switch Statement Components

Switch statement

switch statement let’s you check the value of a certain variable (like our coffee maker passcode) and test it for equality against a list of possible values that it can take.

Each of these specific values is called a case and you can program different behavior for each case.

In Java this looks like this:

coffee maker switch

This code checks the value of passcode, which is some 3-digit integer value, and compares it to the specific case values: 555312, and 629.

Then if the variable equals a certain case value, the code after that case will be executed. For example, in the code above, if passcode is equal to 312 then the coffeeType String will be set to ”Vanilla latte”.

Break;

After this code is this word break; which will break out of the case code and go to the ending curly brace of the switch statement, where this code prints the value of coffeeType.

So the break ensures that only one case at a time will have it’s code executed.

If the break were not included, Java would continue reading code in the switch statement line by line and keep executing statements (like the default case code) until it reaches the end of the switch statement or hits another break!

Default case

The default case typically comes at the end of a switch statement and its code will execute whenever the other cases aren’t met. So, if the passcode was something like 914, this code doesn’t have a case for this particular value, and so it would fall into the default category and the coffeeType String would be set to “Unknown”.