Sravani S has Published 86 Articles

How to identify that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate in HTML?

Sravani S

Sravani S

Updated on 03-Mar-2020 05:28:15

53 Views

Use the default attribute to identify that the track is to be enabled, if you’re providing with two subtitle tracks for the video.ExampleYou can try the following code to implement the default attribute for tracks −                                                            Your browser does not support the video element.          

Converting Strings to Numbers and Vice Versa in Java.

Sravani S

Sravani S

Updated on 26-Feb-2020 09:51:01

1K+ Views

Java lang package provides Integer class which has methods to convert an integer to String and vice versa. You can convert a String to an integer using the parseInt() method and Integer to String using the toString() method.ExampleLive Demopublic class Sample {    public static void main(String args[]){       ... Read More

How to Split a String with Escaped Delimiters?

Sravani S

Sravani S

Updated on 26-Feb-2020 09:42:44

286 Views

The split(String regex) method of the String class splits this string around matches of the given regular expression.ExampleLive Demopublic class Sample{    public static void main(String args[]){       String s = "|A|BB||CCC|||";       String[] words = s.split("\|");       for (String string : words) {          System.out.println(string);       }    } }OutputA BB CCC

Search and Replace with Java regular expressions

Sravani S

Sravani S

Updated on 26-Feb-2020 08:09:33

874 Views

Java provides the java.util.regex package for pattern matching with regular expressions. Java regular expressions are very similar to the Perl programming language and very easy to learn.A regular expression is a special sequence of characters that help you match or find other strings or sets of strings, using a specialized ... Read More

What does the method indexOf(obj o) do in java?

Sravani S

Sravani S

Updated on 20-Feb-2020 12:19:30

98 Views

The indexOf(Object) method of the java.util.ArrayList class returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.Exampleimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ... Read More

What does the method remove(obj o) do in java?

Sravani S

Sravani S

Updated on 20-Feb-2020 12:14:54

74 Views

The remove(Object) method of the class java.util.ArrayList removes the first occurrence of the specified element from this list, if it is present. If the list does not contain the element, it is unchanged.Exampleimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList ... Read More

How to define an array size in java without hardcoding?

Sravani S

Sravani S

Updated on 19-Feb-2020 12:08:44

451 Views

To avoid hard coding you can read the size of the array from the user using command line arguments of the reader classes like Scanner. Then using this value create an array:Exampleimport java.util.Arrays; import java.util.Scanner; public class PopulatingAnArray {    public static void main(String args[]) {       ... Read More

How to convert a PDF to byte array in Java?

Sravani S

Sravani S

Updated on 19-Feb-2020 10:58:42

7K+ Views

You can read data from a PDF file using the read() method of the FileInputStream class this method requires a byte array as a parameter.Exampleimport java.io.File; import java.io.FileInputStream; import java.io.ByteArrayOutputStream; public class PdfToByteArray {    public static void main(String args[]) throws Exception {       File file = ... Read More

How to handle Java Array Index Out of Bounds Exception?

Sravani S

Sravani S

Updated on 19-Feb-2020 10:49:26

14K+ Views

Generally, an array is of fixed size and each element is accessed using the indices. For example, we have created an array with size 9. Then the valid expressions to access the elements of this array will be a[0] to a[8] (length-1).Whenever you used an –ve value or, the value ... Read More

Loading 3rd party libraries in SAPUI5

Sravani S

Sravani S

Updated on 18-Feb-2020 07:28:51

752 Views

JavaScript includes various third-party libraries that ease the development while working on SAP UI5 app. You can use following jQuery as below −jQuery.sap.require("sap.ui.thirdparty.jqueryui.jquery-ui-core");Other common JavaScript libraries that are in use −MomentJSLoadshTo load a third party library in SAP UI app project, create a folder “libs”. This folder is used to ... Read More

Previous 1 ... 3 4 5 6 7 ... 9 Next
Advertisements