Java2Blog
  • Home
  • Core Java
  • Tutorials
    • Spring
    • Spring Boot
    • Spring MVC
    • Java 8
    • Hibernate
  • Categories
    • Interview Questions
    • Spring Frameworks
    • Core java
    • Python
    • C++
  • NM
close
import_contacts

Java Tutorials

  • Core Java
  • Java Interview questions
  • Java 8 Stream
  • Java interview programs
import_contacts

Data structure and algorithm

  • Data structure in java
  • Data structure interview questions
import_contacts

Spring tutorials

  • Spring tutorial
  • Spring boot tutorial
  • Spring MVC tutorial
  • Spring interview questions

java programs

  • Basic java programs Number
    18 January

    Even odd program in java

    In this post,we will see how to check if number is even odd. It is one of the basic programs of Java programming language. [crayon-683a51ade489e528187505/] Output: Enter a Number : 22 22 is an Even Number That’s all about Even odd program in java.

    Read More
  • Basic java programs Number
    18 January

    Java Program to add two numbers

    In this post, we will see how to add two numbers in java. This is the most basic program of java programming language. [crayon-683a51ade4afa792155011/] Output: Enter two numbers : 5 7 Sum of two numbers is 12 If you notice, we have use Scanner to take input from user.

    Read More
  • Basic java programs Core Java interview Number
    24 December

    Reverse number in java

    In this post, we will see how to reverse a number in java. Here is simple program to reverse a number. [crayon-683a51ade4b93670086811/] Output: Enter a Number : 4567 Reverse of the number : 7654 Let’s just observe values of variables at the end of each iteration. Iteration 0: number = 4567,remainder = 0, reversedNumber = […]

    Read More
  • Basic java programs
    17 November

    Java program to print floyd’s triangle

    In this post, we will see how to print Floyd’s triangle in java. Problem You need to print Floyd’s triangle as below for n=5. Floyd’s triangle **************** 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Floyd’s triangle in java Let’s create class "FloydTriangleMainExample.java" as below [crayon-683a51ade4c29178019300/] When you […]

    Read More
  • Basic java programs Core Java interview String
    27 October

    Count number of words in a string

    In this post, we will see how to find number of words in a String. Problem Find the number of words in a String. For example: There are 6 words in below String welcome to java tutorial on Java2blog Algorithm The algorithm will be very simple. Initialize count with 1 as if there are no […]

    Read More
  • Java interview programs
    Interview Questions java programs Core Java interview Interview
    10 June

    Java Interview Programs for Logic Building

    In this tutorial, we will see Java interview programs for logic building. These java programs will help students to crack Java interview. Here is the list of Top 10 Java interview programs for logic building. Question 1: Check if number is odd or even? Answer: It is a very basic question. You need to check […]

    Read More
  • Basic java programs Number
    20 January

    How to check if number is power of two

    In this tutorial, we will see how to check if number is power of two. There are many approaches to check if number is power of two or not. Approach 1: It is very easy and straight forward approach. Run a while loop which checks for condition if n is even number (n%2==0). If n is […]

    Read More
  • Algorithm Interview Array java programs
    24 September

    Java Program to Find Second Largest Number in An Array

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Overview In this post, we will see how to find the second largest number in an array. This is a one of common interview questions on array data structure. 2. Introduction to Problem Statement Given […]

    Read More
  • Algorithm Interview Array java programs
    16 September

    Java Program to Find Missing Number in An Array

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. 1. Overview In this article, we will see how to find missing number in Array of 1 to n. This is one of basic coding interview question asked in my interviews. 2. Introduction to Problem Statement […]

    Read More
  • keyboard_arrow_left Previous
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • 8
  • Nextkeyboard_arrow_right

Newsletter


Let’s be Friends

  • Facebook
  • Twitter
  • LinkedIn

© 2020-22 Java2Blog Privacy Policy