Arushi has Published 157 Articles

Use a quantifier to find a match in Java

Arushi

Arushi

Updated on 30-Jul-2019 22:30:24

59 Views

One of the quantifiers is the plus(+). This matches one or more of the subsequence specified with the sequence.A program that demonstrates using the quantifier plus(+) to find a match in Java is given as follows:Example Live Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Demo {    public static void main(String args[]) ... Read More

Stack in Java Programming

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

164 Views

Stack is a subclass of Vector that implements a standard last-in, first-out stack. Stack only defines the default constructor, which creates an empty stack. Stack includes all the methods defined by Vector, and adds several of its own. Stack( ) Apart from the methods inherited from its parent ... Read More

How to convert HTML to PDF using Python

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

1K+ Views

Python provides Pdfcrowd API v2 which is convert HTML documents to PDF. This API is very easy to use and the integration takes only a couple of lines of code. Installation Install the client library from PyPI $ pip install pdfcrowd Conversion will be completed in following 3 ... Read More

Python program to convert an array to an ordinary list with the same items

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

116 Views

The array is given. Our task is to convert an array to an ordinary list. We solve this problem with the help of tolist() function. This function return the array as a (possibly nested) list. Algorithm Step 1: Given an array. Step 2: convert the array to a list ... Read More

Swap two Strings without using third user defined variable in Java

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

192 Views

In order to swap two strings i.e interchange the content of two strings we will use sub string method of string class in Java.First of all get the length of both strings before making any change in any of string.Now modify one string as concatenate both strings and assign to ... Read More

Python program to find k'th smallest element in a 2D array

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

353 Views

One n×n user input integer matrix is given and the value of k. Our task is to find out k'th smallest element in a 2D array. Here we use heapq mudule.Heap queue (or heapq) in Python. In Python, it is available using “heapq” module. The technique of this module ... Read More

Python program to check whether two lists are circularly identical

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

575 Views

Here two lists are given. Our task is to check and found weather two given lists are circularly identical or not. Example Input : A = [100, 100, 10, 10, 100] B = [100, 100, 100, 10, 10] Output : True ... Read More

Math class methods in Java Programming

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

335 Views

The java.lang.Math class contains methods for performing basic numeric operations such as the elementary exponential, logarithm, square root, and trigonometric functions. Class Declaration Following is the declaration for java.lang.Math class − public final class Math extends Object Field Following are the fields for java.lang.Math class ... Read More

Null Pointer Exception in Java Programming

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

3K+ Views

NullPointerException is a runtime exception and it is thrown when the application try to use an object reference which has a null value. For example, using a method on a null reference. Example Live Demo public class Tester { public static void main(String[] args) { ... Read More

Print a 2 D Array or Matrix in Java Programming

Arushi

Arushi

Updated on 30-Jul-2019 22:30:23

1K+ Views

In this post we will try to print an array or matrix of numbers at console in same manner as we generally write on paper. For this the logic is to access each element of array one by one and make them print separated by a space and when row ... Read More

Advertisements