Rishi Raj has Published 119 Articles

Pass long parameter to an overloaded method in Java

Rishi Raj

Rishi Raj

Updated on 30-Jun-2020 08:41:58

3K+ Views

Method overloading in a class contains multiple methods with the same name but the parameter list of the methods should not be the same. One of these methods can have a long parameter in their parameter list.A program that demonstrates this is given as follows −Example Live Democlass PrintValues {   ... Read More

Role of Matcher.find(int) method in Java Regular Expressions

Rishi Raj

Rishi Raj

Updated on 30-Jun-2020 08:37:18

272 Views

The Matcher.find(int) method finds the subsequence in an input sequence after the subsequence number that is specified as a parameter. This method is available in the Matcher class that is available in the java.util.regex package.The Matcher.find(int) method has one parameter i.e. the subsequence number after which the subsequence is obtained ... Read More

Why variables are declared final in Java

Rishi Raj

Rishi Raj

Updated on 30-Jun-2020 08:32:59

1K+ Views

A variable cannot be modified after it is declared as final. In other words, a final variable is constant. So, a final variable must be initialized and an error occurs if there is any attempt to change the value.A program that demonstrates a final variable in Java is given as ... Read More

Get current thread in Java

Rishi Raj

Rishi Raj

Updated on 30-Jun-2020 08:30:48

16K+ Views

A thread can be created by implementing the Runnable interface and overriding the run() method.The current thread is the currently executing thread object in Java. The method currentThread() of the Thread class can be used to obtain the current thread. This method requires no parameters.A program that demonstrates this is ... Read More

Enumerate through the Vector elements in Java

Rishi Raj

Rishi Raj

Updated on 30-Jun-2020 08:25:07

730 Views

The Vector elements can be traversed using the Enumeration interface. The method hasMoreElements( ) returns true if there are more elements to be enumerated and false if there are no more elements to be enumerated. The method nextElement( ) returns the next object in the enumeration.A program that demonstrates this ... Read More

How a Vector can be cloned in Java

Rishi Raj

Rishi Raj

Updated on 30-Jun-2020 08:16:58

297 Views

A Vector can be cloned using the java.util.Vector.clone() method. This method does not take any parameters but returns a clone of the specified Vector instance as an object.A program that demonstrates this is given as follows −Example Live Demoimport java.util.Vector; public class Demo {    public static void main(String args[]) { ... Read More

How to set the minimum width of an element with JavaScript?

Rishi Raj

Rishi Raj

Updated on 23-Jun-2020 13:25:42

1K+ Views

Use the minWidth property in JavaScript to set the minimum width. You can try to run the following code to set the minimum width of an element with JavaScript −ExampleLive Demo                    #box {             ... Read More

How to set the left position of a positioned element with JavaScript?

Rishi Raj

Rishi Raj

Updated on 23-Jun-2020 12:31:43

1K+ Views

Use the left property to set the left position of a positioned element, such as a button.ExampleYou can try to run the following code to set the left position of a positioned element with JavaScript −Live Demo                    #myID { ... Read More

How to set a background image to be fixed with JavaScript DOM?

Rishi Raj

Rishi Raj

Updated on 23-Jun-2020 09:21:58

639 Views

To set the background image to be fixed in JavaScript, use the backgroundAttachment property. It allows you to set an image that won’t scroll.ExampleYou can try to run the following code to learn how to work with backgroundAttachment property with JavaScript −Live Demo           Click ... Read More

How can we use INFORMATION_SCHEMA to get the details about triggers in a particular database?

Rishi Raj

Rishi Raj

Updated on 22-Jun-2020 12:06:26

157 Views

It can be done with the help of the following statement −mysql> select * from information_schema.triggers where     -> information_schema.triggers.trigger_schema like '%query%'\G *************************** 1. row ***************************             TRIGGER_CATALOG: def              TRIGGER_SCHEMA: query               ... Read More

Advertisements