Abhinanda Shri has Published 79 Articles

Execute a script when fetching the media data is stopped before it is completely loaded in HTML?

Abhinanda Shri

Abhinanda Shri

Updated on 03-Mar-2020 07:00:28

251 Views

Use the onsuspend attribute in HTML to run the script when the loading of media data suspends, for example, when download completes. It can happen in any of the following situations −When a download is paused When a download completes Media is suspended, etc.The attribute can be used with the ... Read More

How do we define an area in an image map with HTML?

Abhinanda Shri

Abhinanda Shri

Updated on 03-Mar-2020 06:28:47

354 Views

Use the tag to define area in an image map in HTML.The HTML tag supports the following additional attributes −AttributeValueDescriptionAltTextSpecifies an alternate text for the area.coordsif shape = "rect" then coords = "left, top, right, bottom"if shape = "circ" then coords = "centerx, centery, radius"if shape = "poly" ... Read More

How to set the script to be executed asynchronously in HTML?

Abhinanda Shri

Abhinanda Shri

Updated on 02-Mar-2020 12:41:44

77 Views

Use the async attribute to set the script to execute asynchronously as and when it is available. It only uses the external script.Firstly, add a js file. Let us give it a name, new.js, function sayHello() {    alert("Hello World") }Let’s add the HTML code now and execute the above ... Read More

What is the usage of fill() method in JavaScript?

Abhinanda Shri

Abhinanda Shri

Updated on 02-Mar-2020 06:40:47

76 Views

The fill() method in JavaScript is used to fill elements with static value in an array. The following are the parameters for fill() −value− The value to be filled.begin− The start index to begin filling the array.end− The ending index to stop filling the array.ExampleYou can try to run the ... Read More

Java string case change sample code examples.

Abhinanda Shri

Abhinanda Shri

Updated on 26-Feb-2020 09:49:50

69 Views

You can change the cases using the toUpperCase() and toLowerCase() methods of the String class.ExampleLive Demopublic class Sample {    public static void main(String args[]){       String str = "Hello how are you";       String strUpper = str.toUpperCase();       System.out.println("Lower to upper : "+strUpper);     ... Read More

Remove whitespace in Java string.

Abhinanda Shri

Abhinanda Shri

Updated on 26-Feb-2020 08:14:34

342 Views

You can remove empty spaces from a string using the replace() method of the String classExampleLive Demopublic class StringwhiteSpace {    public static void main(String args[]){       String str = "Welcome to Tutorialspoint";       str = str.replace(" ", "");       System.out.println(str);    } }OutputWelcometoTutorialspoint

How to split a Java String into tokens with StringTokenizer?

Abhinanda Shri

Abhinanda Shri

Updated on 26-Feb-2020 07:06:25

340 Views

The hasMoreTokens() method is used to test if there are more tokens available from this tokenizer's string.ExampleLive Demoimport java.util.*; public class StringTokenizerDemo {    public static void main(String[] args) {       // creating string tokenizer       StringTokenizer st = new StringTokenizer("Come to learn");       ... Read More

How to copy or clone a Java ArrayList?

Abhinanda Shri

Abhinanda Shri

Updated on 25-Feb-2020 09:50:14

1K+ Views

The clone() method of the java.util.ArrayList class returns a shallow copy of this ArrayList instance (i.e the elements themselves are not copied). Using this method, you can copy the contents of one array list to other.Exampleimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String args[]) {       ... Read More

Java API documentation generator

Abhinanda Shri

Abhinanda Shri

Updated on 25-Feb-2020 05:08:14

478 Views

Following program uses few of the important tags available for documentation comments. You can make use of other tags based on your requirements.The documentation about the AddNum class will be produced in HTML file AddNum.html but at the same time, a master file with a name index.html will also be ... Read More

What does the method set(int, obj o) do in java?

Abhinanda Shri

Abhinanda Shri

Updated on 20-Feb-2020 12:22:09

70 Views

The set() method of the ArrayList class replaces the element at the specified position in this list with the specified element.Exampleimport java.util.ArrayList; public class Sample {    public static void main(String args[]) {       ArrayList al = new ArrayList();       System.out.println("Initial size of al: " + al.size()); ... Read More

Advertisements