Shriansh Kumar has Published 175 Articles

Slicker Algorithm to Find the Area of a Polygon in Java

Shriansh Kumar

Shriansh Kumar

Updated on 12-May-2023 16:23:51

234 Views

The term ‘Polygon’ originated from the Greek words ‘Poly’ which means ‘many’ and ‘gon’ which means ‘angle’. A polygon is a two dimensional closed plane shape created by connecting three or more than three straight lines. For example, triangle, quadrilateral, hexagon and so forth. Although there are many ways ... Read More

Starting with first Servlet Application

Shriansh Kumar

Shriansh Kumar

Updated on 08-May-2023 10:21:05

272 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 ... Read More

StackOverflowError in Java with Examples

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 18:18:33

500 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 ... Read More

Sort and Search an Element in Java

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 18:16:52

1K+ 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 ... Read More

Java Program for Case Specific Sorting

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 18:13:00

528 Views

Suppose you have a String that contains uppercase and lowercase characters both. We have to sort this given string in case specific order 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 ... Read More

StrictMath subtractExact() in Java With Examples

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 18:11:13

86 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 ... Read More

Java Program for Search an element in a sorted and rotated array

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 18:04:44

234 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 ... Read More

StringJoiner Class vs String.join() Method to Join String in Java

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 18:01:43

395 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 ... Read More

Scanner and nextChar() in Java

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 17:59:18

2K+ Views

Scanner is a class available in ‘java.util’ package used to take input from numerous sources like a file, or console. The most common source of taking input is from standard input i.e. keyboard. The scanner class has few methods to take input of primitives and strings from the keyboard. We ... Read More

String Arrays in Java

Shriansh Kumar

Shriansh Kumar

Updated on 05-May-2023 17:57:50

679 Views

String and Arrays are two distinct things. Array is a linear data structure that is used to store group of elements with similar datatypes but a string is a class in Java that stores a series of characters. Those characters are actually String-type objects. Since strings are objects we can ... Read More

Advertisements