Articles on Trending Technologies

Technical articles with clear explanations and examples

HTML DOM Input Number required Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 174 Views

The HTML DOM input number required property returns and modify whether the input number field must be filled out before submitting the form.SyntaxFollowing is the syntax −Returning requiredobject.requiredModifying requiredobject.required = true | falseExampleLet us see an example of HTML DOM input number required property −    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    }    input{       ...

Read More

The listIterator() method of CopyOnWriteArrayList in Java starting at a specified position

Ankith Reddy
Ankith Reddy
Updated on 11-Mar-2026 176 Views

The listIterator() method CopyOnWriteArrayList class returns a list iterator over the elements in this list, beginning at the specified position in the list.The syntax is as followspublic ListIterator listIterator(int index)Here, index is the index of the first element to be returned from the list iterator.To work with CopyOnWriteArrayList class, you need to import the following packageimport java.util.concurrent.CopyOnWriteArrayList;The following is an example to implement CopyOnWriteArrayList class listIterator() method in Java. We have set the index as 3, therefore, the list would be iterated from index 3Exampleimport java.util.Iterator; import java.util.ListIterator; import java.util.concurrent.CopyOnWriteArrayList; public class Demo {    public static void main(String[] args) ...

Read More

HTML DOM Input Number placeholder Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 265 Views

The HTML DOM input number placeholder property returns and modify the value of the placeholder attribute of number input field.SyntaxFollowing is the syntax −Returning placeholderobject.placeholderModifying placeholderobject.placeholder = “text”ExampleLet us see an example of HTML DOM input number placeholder property −    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    }    input{       display:block;       width:35%; ...

Read More

Can we define a static constructor in Java?

raja
raja
Updated on 11-Mar-2026 5K+ Views

No, we cannot define a static constructor in Java, If we are trying to define a constructor with the static keyword a compile-time error will occur.In general, static means class level. A constructor will be used to assign initial values for the instance variables. Both static and constructor are different and opposite to each other. We need to assign initial values for an instance variable we can use a constructor. We need to assign static variables we can use Static Blocks.Examplepublic class StaticConstructorTest {    int x = 10;    // Declaratiopn of Static Constructor    static StaticConstructorTest() {   ...

Read More

Use a character class in Java Regular Expressions

Vikyath Ram
Vikyath Ram
Updated on 11-Mar-2026 218 Views

A character class is set of characters that are enclosed inside square brackets. The characters in a character class specify the characters that can match with a character in an input string for success. An example of a character class is [a-z] which denotes the alphabets a to z.A program that demonstrates a character class in Java Regular Expressions is given as follows:Exampleimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Demo {    public static void main(String args[]) {       Pattern p = Pattern.compile("[a-z]+");       Matcher m = p.matcher("the sky is blue");       System.out.println("The input string ...

Read More

KeyPairGenerator getProvider() method in Java

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 119 Views

The provider of the key pair object can be obtained using the getProvider() method in the class java.security.KeyPairGenerator. This method requires no parameters and it returns the provider of the key pair object.A program that demonstrates this is given as follows −Exampleimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("DSA");          Provider p = kpGenerator.getProvider();          System.out.println("The Provider is: " + p.getName());       } catch (NoSuchAlgorithmException e) { ...

Read More

HTML DOM Input Number step Property

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 158 Views

The HTML DOM input number step property returns and modify the value of the step attribute of input number field in an HTML document.SyntaxFollowing is the syntax −Returning stepobject.stepModifying stepobject.step = “number”ExampleLet us see an example of HTML DOM input month step property −    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.1rem;    }    input{       display:block; ...

Read More

HTML <meter> value Attribute

Ankith Reddy
Ankith Reddy
Updated on 11-Mar-2026 171 Views

The value attribute of the element specifies the current value of the gauge. This is a required attribute.Following is the syntax −Above, num represents the current value as a floating-point number.Let us now see an example to implement the value attribute of the element −Example    Result    Girls pass %    Boys pass % OutputIn the above example, we have set the pass percentage of girls as well as boys using the element. The current value is set using the value attribute −Boys pass %

Read More

Is there any advantage to using __construct() instead of the class's name for a constructor in PHP?

Alok Prasad
Alok Prasad
Updated on 11-Mar-2026 517 Views

Yes, there are several advantages to using the magic function __construct() instead of the class's name. Those are listed below −The magic function __construct is introduced in PHP 5.4. One advantage of using __construct() over ClassName() as a constructor is if you change the name of the class, you don't need to update the constructor which supports DRY(don't repeat yourself) concept.If you have a child class you can call parent::__construct()to call the parent constructor in an easy way.ExampleOutputThe class "myclass" was initiated! In SubClass constructorNote"__CLASS__" is what’s called a magic constant, which, in this case, returns the name of the ...

Read More

HTML DOM Input Number defaultValue Property

Sharon Christine
Sharon Christine
Updated on 11-Mar-2026 127 Views

The HTML DOM input number defaultValue property returns and modify the default value of input field of type=”number” in a HTML document.SyntaxFollowing is the syntax minus;Returning default valueobject.defaultValuemodifying default valueobject.defaultValue=”number”ExampleLet us see an example of HTML DOM input number defaultValue property−    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.2rem;    }    input{       width:35%;       ...

Read More
Showing 8561–8570 of 61,248 articles
« Prev 1 855 856 857 858 859 6125 Next »
Advertisements