Abhinanda Shri has Published 69 Articles

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

Abhinanda Shri

Abhinanda Shri

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

136 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

149 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

142 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

How to split a Java String into tokens with StringTokenizer?

Abhinanda Shri

Abhinanda Shri

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

480 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

2K+ 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

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

Abhinanda Shri

Abhinanda Shri

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

120 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

What does the method size() do in java?

Abhinanda Shri

Abhinanda Shri

Updated on 20-Feb-2020 12:16:41

829 Views

The size() method of the class java.util.ArrayList returns the number of elements in this list i.e. the size of the list.Exampleimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ArrayList(5);       arrlist.add(15);       arrlist.add(20); ... Read More

How to store a 2d Array in another 2d Array in java?

Abhinanda Shri

Abhinanda Shri

Updated on 19-Feb-2020 11:22:53

3K+ Views

Create an array to which you want to store the existing array with the same length. A 2d array is an array of one dimensional arrays therefore, to copy (or, to perform any operation on) the elements of the 2d array you need two loops one nested within the other. ... Read More

Accessing Source code of SAP Transport without using SAP system

Abhinanda Shri

Abhinanda Shri

Updated on 14-Feb-2020 08:13:04

378 Views

I don’t think it is possible to check source code without SAP system until you understand SAP Binary code. The format in which the data are stored in the data file is AFAIK, an SAP own format and you can use R3trans to read code using the command.R3trans -l ... Read More

Conditional ternary operator ( ?: ) in C++

Abhinanda Shri

Abhinanda Shri

Updated on 11-Feb-2020 05:30:35

641 Views

The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows −The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.If the first operand evaluates to true (1), the second operand is evaluated.If ... Read More

Advertisements