
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

598 Views
The java.util.Scanner class is a simple text scanner which can parse primitive types and strings using regular expressions.1. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace.2. A scanning operation may block waiting for input.3. A Scanner is not safe for multi-threaded use without external synchronization.The nextInt() method of the Scanner class is used to read an integer value from the source.Exampleimport java.util.Scanner; public class ReadingNumbersFromUser { public static void main(String args[]){ Scanner sc = new Scanner(System.in); System.out.println("Enter a number ::"); int num ... Read More

598 Views
The java.util.Scanner class is a simple text scanner which can parse primitive types and strings using regular expressions.1. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace.2. A scanning operation may block waiting for input.3. A Scanner is not safe for multi-threaded use without external synchronization.The nextInt() method of the Scanner class is used to read an integer value from the source.Exampleimport java.util.Scanner; public class ReadingNumbersFromUser { public static void main(String args[]){ Scanner sc = new Scanner(System.in); System.out.println("Enter a number ::"); int num ... Read More

12K+ Views
The * operator in Java is used to multiply two numbers. Read required numbers from the user using Scanner class and multiply these two integers using the * operator.Exampleimport java.util.Scanner; public class MultiplicationOfTwoNumbers { public static void main(String args[]){ Scanner sc = new Scanner(System.in); System.out.println("Enter the value of the first number ::"); int a = sc.nextInt(); System.out.println("Enter the value of the first number ::"); int b = sc.nextInt(); int result = a*b; System.out.println("Product of the given two numbers ... Read More

12K+ Views
The * operator in Java is used to multiply two numbers. Read required numbers from the user using Scanner class and multiply these two integers using the * operator.Exampleimport java.util.Scanner; public class MultiplicationOfTwoNumbers { public static void main(String args[]){ Scanner sc = new Scanner(System.in); System.out.println("Enter the value of the first number ::"); int a = sc.nextInt(); System.out.println("Enter the value of the first number ::"); int b = sc.nextInt(); int result = a*b; System.out.println("Product of the given two numbers ... Read More

765 Views
In this article, we will learn to print the ASCII value of a particular character in Java. ASCII (American Standard Code for Information Interchange) is a standard encoding system that assigns a unique numeric value to characters like letters, digits, and symbols. We’ll explain the concept of ASCII, demonstrate how to retrieve and display ASCII values in Java and provide practical examples to help you understand and apply this concept effectively. What Is ASCII? ASCII is a character encoding standard where each character (letters, digits, and symbols) is assigned a numeric value. For instance − ... Read More

79K+ Views
In this article, we will learn to find if a year is a leap year or not using Java. Finding whether a year is a leap or not is a bit tricky. We generally assume that if a year number is evenly divisible by 4 is a leap year. But it is not the only case. A year is a leap year if − It is evenly divisible by 100 If it is divisible by 100, then it should also be divisible by 400 Except this, all ... Read More

79K+ Views
In this article, we will learn to find if a year is a leap year or not using Java. Finding whether a year is a leap or not is a bit tricky. We generally assume that if a year number is evenly divisible by 4 is a leap year. But it is not the only case. A year is a leap year if − It is evenly divisible by 100 If it is divisible by 100, then it should also be divisible by 400 Except this, all ... Read More

2K+ Views
In this article, we will learn to reverse a string using recursion in Java. Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is known as a recursive call of the function. You can reverse a string using the recursive function as shown in the following program. Steps to reverse a string using recursion Following are the steps to reverse a string using recursion - Create a class called StringReverse with a method reverseString that takes ... Read More

2K+ Views
Any whole number which is greater than 1 and has only two factors i.e. 1 and the number itself, is called a prime number. Other than these two number it has no positive divisor. In this article, we will explain Java programs to print prime numbers between 1 to 100. Few examples of prime numbers are − 2, 3, 5, 7, 11 etc. Steps to Print Prime numbers below 100 Follow the steps below to print prime numbers below 100 in Java − Take integer variable, let's say "A" Divide the variable A with (A-1 to 2) If A ... Read More

2K+ Views
Any whole number which is greater than 1 and has only two factors i.e. 1 and the number itself, is called a prime number. Other than these two number it has no positive divisor. In this article, we will explain Java programs to print prime numbers between 1 to 100. Few examples of prime numbers are − 2, 3, 5, 7, 11 etc. Steps to Print Prime numbers below 100 Follow the steps below to print prime numbers below 100 in Java − Take integer variable, let's say "A" Divide the variable A with (A-1 to 2) If A ... Read More