Core Java Tutorial

January 9, 2023

Spring Boot is an opinionated, easy to get-started addition to the Spring platform – highly useful for creating stand-alone, production-grade applications with minimum effort.

In this series, we’ll first cover the basics of Spring Boot. The reader will learn how to get started, how Spring Boot differs from Spring, how to customize and test the application.

Then we’ll cover some selected advanced topics like persistence, DevOps tools, and a few other useful topics which can be useful to get started with Spring Boot.


public class Main {

  public static void main(String[] args) {

    int num = 29;
    boolean flag = false;
    for (int i = 2; i <= num / 2; ++i) {
      // condition for nonprime number
      if (num % i == 0) {
        flag = true;
        break;
      }
    }

    if (!flag)
      System.out.println(num + " is a prime number.");
    else
      System.out.println(num + " is not a prime number.");
  }
}

You Might Also Like