
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 33676 Articles for Programming

287 Views
Golang is a programming language that has gained immense popularity in recent years. One of its many features is the ability to generate random numbers of different types. In this article, we will focus on generating random Int31n type numbers in Golang. Int31n is a type of 32-bit signed integer. It is a commonly used data type in programming and is often required for a wide range of applications. Here's how you can generate random numbers of type Int31n in Golang. Step 1: Import the Math/rand Package To generate a random number in Golang, you need to import the math/rand ... Read More

314 Views
Random number generation is an essential feature of many programming applications. In Golang, you can generate random numbers of different types, including Int31. In this article, we will discuss how to generate random Int31 type numbers in Golang. What is Int31 Type? Int31 is a data type in Golang that represents a signed 32-bit integer number. The Int31 type is useful when you need to generate random numbers within the range of -2147483648 to 2147483647. Generating Random Int31 Type Numbers in Golang To generate a random Int31 type number in Golang, you can use the rand.Int31() function from the math/rand ... Read More

509 Views
Servlets are small java modules that are used on server side of a web connection to enhance the functionality of web server. All the methods and classes for creating a servlet are available in ‘javax.servlet’ and ‘javax.servlet.http’ packages. Hence, it is important to import them into your program before working with the servlet. This article will guide you step by step to getting started with your first servlet application. Before moving on it is necessary to know how servlet works. Let’s discuss it briefly. Servlets The benefits of using servlets are as follows − Just like the java ... Read More

918 Views
When the stack ran out of space then StackOverflowError occurs. It is a runtime error indicating that JVM has run out of resources. The main reasons for this kind of error may be: Circular references, infinite Recursion or heavy application that utilizes more memory. In this article, we will discuss the above listed reasons for StackOverflowError in the simplest way possible. StackOverflowError in Java Memory Mnagement in java Before moving to the StackOverflowError it is important to know about how memory space managed by java for a particular program or application. Every interface, class, object, variable and method of a ... Read More

3K+ Views
Sorting and searching are the basic operations we can perform on arrays. Sorting means rearranging the elements of a given list or array in ascending or descending order whereas searching means finding an element or its index in a list. Although various algorithms are available to perform these operations, in this article, we will use a few of them to sort and search an element in java. One by one we will look at them. Approach 1: Using inbuilt methods of Arrays In this section, we will discuss the following methods that helps in sorting and searching of elements in ... Read More

604 Views
In java, StreamCorruptedException occurs when problem is found with the data being read from or written to a stream. The problem may be the data we are reading or writing is in the wrong format or contains errors. If the format of given file is not correct. When stream has been closed unexpectedly or the data has been partially overwritten. In this article, we will talk about StreamCorruptedException with examples. But before moving on it is important to understand streams and few of its method that we are going to use in examples. Program to handle StreamCorruptedException Streams Stream ... Read More

817 Views
Suppose you have a String that contains uppercase and lowercase characters both. We have to sort this given string in case specific order which means if the ith position in the given string had an uppercase letter then the newly sorted string must have uppercase letter at that position and same goes for lowercase letters. Also, both lowercase and uppercase letters will be in sorted order separately. In this article, we will try to find the solution for the given problem. First, let's understand the given problem with an example for better understanding. Example Scenario Input: String st = ... Read More

167 Views
In java, the subtractExact() is a static method of the class StrictMath. It is available in ‘java.lang’ package. In this article, we will discuss StrictMath and some of its inbuilt methods. We will also see the implementation of subtractExact() method and how it is different from other methods of this class. StrictMath Class in Java StrictMath is a final class that extends object class. We can use its methods without creating instance because all the methods of this class are static and we can call a static method without an object. To call a Static Mehtod Class_name.static_method_name To ... Read More

437 Views
Suppose you have a sorted array with no duplicate values and from a certain index this array is rotated. You have to search for a particular element in it. If it is available in the array then return the index otherwise return -1. In this article, we will solve the given problem using two approaches Linear search and Binary search. Approach 1: Using Linear Search This approach will search for the given element in sequential manner. Algorithm Step 1 − First, declare and initialize an array named ‘araylist’ and an integer variable named ‘searchElem’ that we are going ... Read More

747 Views
There are numerous ways of joining strings in java. The StringJoiner class and String.join() method are two of them. Both are used to join two or any number of strings but the difference lies in their implementation. In this article, we will try to find the differences that exist in the usage of StringJoiner class and String.join() method. StringJoiner Class It is a class available in java.util package and it is added from JDK 8. We can join multiple strings at a time. Before using, it is necessary to import it into our program using the following command ... Read More