Sharon Christine has Published 436 Articles

Java Program to perform AND operation on BigInteger

Sharon Christine

Sharon Christine

Updated on 29-Jun-2020 05:40:35

110 Views

The java.math.BigInteger.and(BigInteger val) returns a BigInteger whose value is (this & val). This method returns a negative BigInteger if and only if this and val are both negative. Here, “val” is the value to be AND'ed with this BigInteger.First, create BigInteger objects −BigInteger one, two, three; one = new BigInteger("12"); ... Read More

Left pad a string in Java

Sharon Christine

Sharon Christine

Updated on 27-Jun-2020 06:22:59

611 Views

To left pad a string, use the String.format and set the spaces.String.format("|%20s|", "demotext")If you add 30 above, it will display the first string after 30 spaces from the beginning.String.format("|%30s|", "demotext")Example Live Demopublic class Demo {    public static void main(String []args) {       System.out.print(String.format("|%20s|", "demotext"));       System.out.println("Left ... Read More

DataView.getFloat32() function in JavaScript

Sharon Christine

Sharon Christine

Updated on 25-Jun-2020 10:17:22

67 Views

The getFloat32() function of the DataView gets and returns a signed 32-bit floating point number at the specified position.SyntaxIts syntax is as followsdataView.getFloat32();ExampleTry the following example. Live Demo    JavaScript Example           var arrayBuffer = new ArrayBuffer(8);       var dataView = new ... Read More

How to set the opacity level for an element with JavaScript?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 13:27:01

451 Views

Use the opacity property in JavaScript to set the opacity level. You can try to run the following code to set the opacity level for an element with JavaScript −ExampleLive Demo                    #box {             width: ... Read More

How to set listStyleImage, listStylePosition, and listStyleType in one declaration with JavaScript?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 13:03:09

54 Views

To set the list properties in a single declaration, use the listStyle property in JavaScript.ExampleYou can try to run the following code to set the listStylePosition and listStyleType property in one declaration with JavaScript −Live Demo                    One     ... Read More

How to set the brightness and contrast of an image with JavaScript?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 12:36:37

3K+ Views

To set the brightness, use the brightness property and for contrast, use the contrast property.ExampleYou can try to run the following code to use image filters with JavaScript −Live Demo           Click below to change the brightness and contrast of the image.       ... Read More

How to set fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily in one declaration with JavaScript?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 12:08:47

53 Views

To set all the font properties, use the JavaScript font property. You can try to run the following code to set all font properties in a single declaration with JavaScript −ExampleLive Demo           Heading 1                This is Demo ... Read More

How to set the starting position of a background image in JavaScript DOM?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 10:00:38

298 Views

To set the starting position of a background image in JavaScript, use the backgroundposition property. It allows you to set the position of the image.ExampleYou can try to run the following code to learn how to set all the position of a background image with JavaScript −Live Demo   ... Read More

How to set the color of the bottom border in JavaScript DOM?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 09:14:25

636 Views

To set the color of the bottom border in JavaScript, use the borderBottomColor property. It allows you to set the border color for the bottom of a border.ExampleYou can try to run the following code to learn how to set the color of the bottom border −Live Demo   ... Read More

How to get the value of the usemap attribute in JavaScript?

Sharon Christine

Sharon Christine

Updated on 23-Jun-2020 08:53:15

184 Views

To get the value of the usemap attribute of a link in JavaScript, use the useMap property. The usemap attribute is used to tell that the document is html (text/html) or css (text/css), etc.Client-side image maps are enabled by the usemap attribute for the tag and defined by special ... Read More

Advertisements