BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

How to convert a char array to a string in Java?

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

There are two ways to convert a char array (char[]) to String in Java: 1) Creating String object by passing array name to the constructor… [Read More]

Tags: Java-Conversion

Java program to generate random number – Example

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Example Program to generate random numbers In the below program, we are using the nextInt() method of Random class to serve our purpose. /* Program:… [Read More]

Java program to perform binary search – Example

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Example Program to perform binary search on a list of integer numbers This program uses binary search algorithm to search an element in given list… [Read More]

Java program for linear search – Example

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Example Program: This program uses linear search algorithm to find out a number among all other numbers entered by user. /* Program: Linear Search Example… [Read More]

Java program to print Floyd’s triangle – Example

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Example Program: This program will prompt user for number of rows and based on the input, it would print the Floyd’s triangle having the same… [Read More]

Java Program to Check Whether a Number is Even or Odd

Last Updated: September 9, 2022 by Chaitanya Singh | Filed Under: Java Examples

In this article, we will write two java programs to check whether a number is even or odd. If a number is perfectly divisible by… [Read More]

Java Program to display first n or first 100 prime numbers

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Program to display first n prime numbers import java.util.Scanner; class PrimeNumberDemo { public static void main(String args[]) { int n; int status = 1; int… [Read More]

Java program to display prime numbers from 1 to 100 and 1 to n

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

The number which is only divisible by itself and 1 is known as prime number. For example 2, 3, 5, 7…are prime numbers. Here we… [Read More]

Java program to check prime number

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

The number which is only divisible by itself and 1 is known as prime number, for example 7 is a prime number because it is… [Read More]

java program to check palindrome string using recursion

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Program: Check whether String is palindrome using recursion package beginnersbook.com; import java.util.Scanner; class PalindromeCheck { //My Method to check public static boolean isPal(String s) {… [Read More]

Java Program to check Palindrome string using Stack and Queue

Last Updated: July 26, 2022 by Chaitanya Singh | Filed Under: Java Examples

In this tutorial, you will learn how to write a java program check whether the given String is Palindrome or not. There are following three… [Read More]

java program to find factorial of a given number using recursion

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

Here we will write programs to find out the factorial of a number using recursion. Program 1: Program will prompt user for the input number…. [Read More]

Java program to sum the elements of an array

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

In this tutorial we will see how to sum up all the elements of an array. Program 1: No user interaction /** * @author: BeginnersBook.com… [Read More]

Tags: Java-Array

Java Program to Calculate Area of Rectangle

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

In this tutorial we will see how to calculate Area of Rectangle. Program 1: User would provide the length and width values during execution of… [Read More]

Java program to calculate area of Square

Last Updated: September 10, 2022 by Chaitanya Singh | Filed Under: Java Examples

In this tutorial we will learn how to calculate area of Square. Following are the two ways to do it: 1) Program 1: Prompting user… [Read More]

  • « Previous Page
  • 1
  • …
  • 6
  • 7
  • 8
  • 9
  • Next Page »

Java Examples

  • Check Odd-even
  • Linear Search
  • Binary Search
  • Floyd's Triangle
  • Reverse number
  • Random Number
  • first n prime numbers
  • Disp prime Numbers
  • Check Prime number
  • Palindrome String
  • Find factorial
  • Sum of elements of Array
  • Area of rectangle
  • Area of Square
  • Area of Triangle
  • Circle

Tutorials

  • Java Tutorial
  • OOPs Concepts
  • Java String
  • Exception handling
  • Java Multithreading
  • Java I/O
  • Java Serialization
  • Java Regex
  • Java AWT
  • Java Swing
  • Java Enum
  • Java Annotations

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap