Swarali Sree has Published 75 Articles

How [ ] is converted to String in JavaScript?

Swarali Sree

Swarali Sree

Updated on 23-May-2020 09:55:28

108 Views

Use the String() method in JavaScript to convert to String. You can try to run the following to learn how to convert [ ] to String in JavaScript.ExampleLive Demo           Convert [] to String                var myVal = [];          document.write("String: " + String(myVal));          

What happens to the current MySQL transaction if the session is killed by DBA?

Swarali Sree

Swarali Sree

Updated on 27-Feb-2020 11:09:23

507 Views

Suppose if a session is killed in the middle of a transaction then that current MySQL transaction will be rolled back by MySQL and ended. It means that all the database changes made in the current transaction will be removed. It is called n implicit rollback when the session is ... Read More

In SAP system, how can I find details of Change Request with modification?

Swarali Sree

Swarali Sree

Updated on 25-Feb-2020 11:10:59

456 Views

You can view Transport request that contains detail about your changes by going to T-Code SE37. You have to enter the name of Function Module and click on Utilities → Versions → Version ManagementAlso note that when you don’t put the changes in $TMP package, the system will ask you ... Read More

What is the catch block in Java?

Swarali Sree

Swarali Sree

Updated on 25-Feb-2020 10:42:48

258 Views

A catch statement involves declaring the type of exception you are trying to catch. If an exception occurs in the try block, the catch block (or blocks) that follows the try is checked. If the type of exception that occurred is listed in a catch block, the exception is passed ... Read More

What are I/O classes in Java?

Swarali Sree

Swarali Sree

Updated on 25-Feb-2020 10:31:37

3K+ Views

The java.io package contains nearly every class you might ever need to perform input and output (I/O) in Java. All these streams represent an input source and an output destination. The stream in the java.io package supports many data such as primitives, object, localized characters, etc.A stream can be defined as ... Read More

Where and how can I create a private constructor in Java?

Swarali Sree

Swarali Sree

Updated on 25-Feb-2020 10:17:06

222 Views

We can use a private contractor in a Java while creating a singleton class. The Singleton's purpose is to control object creation, limiting the number of objects to only one. Since there is only one Singleton instance, any instance fields of a Singleton will occur only once per class, just ... Read More

What does the method fill(int[], int fromIndex, int toIndex, int val) do in java?

Swarali Sree

Swarali Sree

Updated on 25-Feb-2020 09:27:53

108 Views

The fill(int[] a, int fromIndex, int toIndex, int val) method of the java.util.Arrays class assigns the specified int value to each element of the specified range of the specified array of integers. The range to be filled extends from index fromIndex, inclusive, to index toIndex, exclusive.(If fromIndex==toIndex, the range to be filled ... Read More

What is the conditional operator ?: in Java?

Swarali Sree

Swarali Sree

Updated on 20-Feb-2020 10:06:14

12K+ Views

The conditional operator is also known as the ternary operator. This operator consists of three operands and is used to evaluate Boolean expressions. The goal of the operator is to decide; which value should be assigned to the variable. The operator is written as:variable x = (expression)? value if true: ... Read More

How to truncate a file in Java?

Swarali Sree

Swarali Sree

Updated on 20-Feb-2020 09:55:21

883 Views

The flush() method of the FileWriter class flushes the contents of the file. You can use this method to truncate a file.Exampleimport java.io.File; import java.io.FileWriter; public class FileTruncate {    public static void main(String args[]) throws Exception {       File file = new File("myData");       ... Read More

How to capture out of array index out of bounds exception in Java?

Swarali Sree

Swarali Sree

Updated on 20-Feb-2020 06:51:48

317 Views

When you try to access an element of an array at an index which is out of range, an ArrayIndexOutOfBoundsException exception is raised.ExampleLive Demopublic class ArrayIndexOutOfBounds {    public static void main(String args[]) {       try {          int[] a = new int[]{1, 2, 3, ... Read More

Advertisements