Chandu yadav has Published 1091 Articles

Get elapsed time in minutes in Java

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 09:25:07

3K+ Views

To get the elapsed time of an operation in minutes in Java, we use the System.currentTimeMillis() method. The java.lang.System.currentTimeMillis() returns the current time in milliseconds.Declaration −The java.lang.System.currentTimeMillis() is declared as follows −public static long currentTimeMillis()The method returns time difference in milliseconds between the current time and midnight, January 1, 1970 ... Read More

Get all the IDs of the Time Zone in Java

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 09:15:09

6K+ Views

To get all the IDs of the TimeZone in Java, we use the getAvailableIDs() method. The getAvailableIDs() method returns all the available IDs which are compatible.Declaration −The java.util.TimeZone.getAvailableIDs() method is declared as follows −public static String[] getAvailableIDs()Let us see a Java program which gets all the IDs of the Time ... Read More

Get the default Time Zone in Java

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 09:13:13

2K+ Views

In order to get the default Time Zone in Java, we use the getDefault() method. The java.util.TimeZone.getDefault() method returns the default TimeZone for the particular host. The source of the default TimeZone varies with the implementation.Declaration −The java.util.TimeZone.getDefault() method is declared as follows −public static TimeZone getDefault()Let us see a ... Read More

CSS background-origin property

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 08:16:48

161 Views

The CSS background-origin property is used to specify position of the background images.ExampleYou can try to run the following code to implement background-origin property:Live Demo                    #demo {             border: 5px dashed red;       ... Read More

How to format message with integer fillers in Java

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 08:09:10

382 Views

To format message with integer fillers in Java, we use the MessageFormat class. The MessageFormat class gives us a way to produce concatenated messages which are not dependent on the language. The MessageFormat class extends the Serializable and Cloneable interfaces.Declaration − The java.text.MessageFormat class is declared as follows −public class ... Read More

Find frequency of each word in a string in Java

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 07:38:47

2K+ Views

In order to get frequency of each in a string in Java we will take help of hash map collection of Java.First convert string to a character array so that it become easy to access each character of string.Now compare for each character that whether it is present in hash ... Read More

overriding method different package in java

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 07:32:47

1K+ Views

TestedThe benefit of overriding is ability to define a behavior that's specific to the subclass type, which means a subclass can implement a parent class method based on its requirement.In object-oriented terms, overriding means to override the functionality of an existing method.Example Live Democlass Animal {    public void move() { ... Read More

Count the Number of matching characters in a pair of Java string

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 07:28:27

2K+ Views

In order to find the count of matching characters in two Java strings the approach is to first create character arrays of both the strings which make comparison simple.After this put each unique character into a Hash map.Compare each character of other string with created hash map whether it is ... Read More

Set printing double-sided documents with CSS

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 07:07:38

576 Views

When printing double-sided documents, the page boxes on the left and right pages should be different.ExampleIt can be expressed through two CSS pseudo-classes as follows −    

Decimal Number System

Chandu yadav

Chandu yadav

Updated on 26-Jun-2020 06:27:01

3K+ Views

Number System represents value of number with respect to its given base. Based on its Base value, a number has unique representation and different number systems have different representation of the same number. For example, Binary, Octal, Decimal and Hexadecimal Number systems are used in microprocessor programming.If the Base value ... Read More

Advertisements