
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7442 Articles for Java

5K+ Views
In this article, we'll generate the Fibonacci series using a while loop in Java. The Fibonacci series is a sequence where each number is the sum of the two previous numbers, starting with two initial numbers, usually either (0, 1) or (1, 1). Here, we start with (1, 1) and use a while loop to print the next numbers in the sequence until a specified limit. Steps to print the Fibonacci series using while loop Following are the steps to print the Fibonacci series using the while loop − Define a class and initialize three variables: a ... Read More

5K+ Views
In this article, we'll generate the Fibonacci series using a while loop in Java. The Fibonacci series is a sequence where each number is the sum of the two previous numbers, starting with two initial numbers, usually either (0, 1) or (1, 1). Here, we start with (1, 1) and use a while loop to print the next numbers in the sequence until a specified limit. Steps to print the Fibonacci series using while loop Following are the steps to print the Fibonacci series using the while loop − Define a class and initialize three variables: a ... Read More

13K+ Views
In this article, we will learn to find whether a given character is a vowel or consonant using Java. In the English alphabet, the characters 'a', 'e', 'i', 'o', and 'u' are vowels and the remaining letters are consonants. To find whether the given letter is a vowel or consonant. Using a loop and or operator verify whether the given character is 'a' or 'e' or 'i' or 'o' or 'u' else it is consonant. Steps to find whether given character is vowel or consonant Following are the steps to find whether given character is a vowel or consonant− ... Read More

13K+ Views
In this article, we will learn to find whether a given character is a vowel or consonant using Java. In the English alphabet, the characters 'a', 'e', 'i', 'o', and 'u' are vowels and the remaining letters are consonants. To find whether the given letter is a vowel or consonant. Using a loop and or operator verify whether the given character is 'a' or 'e' or 'i' or 'o' or 'u' else it is consonant. Steps to find whether given character is vowel or consonant Following are the steps to find whether given character is a vowel or consonant− ... Read More

4K+ Views
The factorial of a number is a fundamental concept in mathematics, representing the product of all positive integers up to that number. Calculating the factorial of a given number is a common problem in programming, and Java provides a straightforward way to achieve this using a while loop. A factorial of a particular number (n) is the product of all the numbers from 0 to n (including n) i.e. factorial of the number 5 will be 1*2*3*4*5 = 120. Problem Statement Given a number write a Java program to calculate the factorial using while loop. Input ... Read More

4K+ Views
The factorial of a number is a fundamental concept in mathematics, representing the product of all positive integers up to that number. Calculating the factorial of a given number is a common problem in programming, and Java provides a straightforward way to achieve this using a while loop. A factorial of a particular number (n) is the product of all the numbers from 0 to n (including n) i.e. factorial of the number 5 will be 1*2*3*4*5 = 120. Problem Statement Given a number write a Java program to calculate the factorial using while loop. Input ... Read More

622 Views
In this article, we will learn how to swap two numbers using the XOR bitwise operator in Java. The XOR operator is a powerful tool that allows you to perform bitwise operations, and one of its interesting properties is that it can be used to swap two variables without using a temporary variable. This method is efficient and can be used when you need a fast swapping mechanism. Problem StatementGiven two integers, write a Java program to swap their values using the XOR operator.Input Two integers are provided by the user.Output The values of the two integers after swapping. ... Read More

622 Views
In this article, we will learn how to swap two numbers using the XOR bitwise operator in Java. The XOR operator is a powerful tool that allows you to perform bitwise operations, and one of its interesting properties is that it can be used to swap two variables without using a temporary variable. This method is efficient and can be used when you need a fast swapping mechanism. Problem StatementGiven two integers, write a Java program to swap their values using the XOR operator.Input Two integers are provided by the user.Output The values of the two integers after swapping. ... Read More

9K+ Views
The circumference of a circle is double the product of its radius and the value of PI. Therefore, to calculate the circumference of a circleGet the radius of the circle form the user.Calculate the productPrint the final result.Example: Finding the circumference of a circle import java.util.Scanner; public class CircumfrenceOfCircle { public static void main(String args[]){ int radius; double circumference; Scanner sc = new Scanner(System.in); System.out.println("Enter the radius of the circle ::"); radius = sc.nextInt(); circumference = Math.PI*2*radius; System.out.println("Circumference ... Read More

9K+ Views
The circumference of a circle is double the product of its radius and the value of PI. Therefore, to calculate the circumference of a circleGet the radius of the circle form the user.Calculate the productPrint the final result.Example: Finding the circumference of a circle import java.util.Scanner; public class CircumfrenceOfCircle { public static void main(String args[]){ int radius; double circumference; Scanner sc = new Scanner(System.in); System.out.println("Enter the radius of the circle ::"); radius = sc.nextInt(); circumference = Math.PI*2*radius; System.out.println("Circumference ... Read More