Anjana has Published 66 Articles

While adding the numbers contained in quotes, how MySQL evaluates if we write non-numeric text before a number?

Anjana

Anjana

Updated on 20-Jun-2020 13:58:45

Suppose if we are trying to add the numbers having non-numeric text before them, then MySQL simply evaluate the value of such number as 0. Following example will exhibit this −Examplemysql> Select 'Kg 1525' + 'Oz 200'As Total; +-------+ | Total | +-------+ | 0     | +-------+ 1 ... Read More

What is the use of MySQL TRUNCATE() function?

Anjana

Anjana

Updated on 20-Jun-2020 10:49:57

MySQL TRUNCATE() function is used to return the value of X truncated to D number of decimal places. If D is 0, then the decimal point is removed. If D is negative, then D number of values in the integer part of the value is truncated. Its syntax can be ... Read More

What MySQL returns if the search string is not in the list of strings provided as argument in FIELD() function?

Anjana

Anjana

Updated on 20-Jun-2020 08:42:27

Suppose if the search string is not in the list of strings provided as the arguments in FIELD() function then MySQL will return 0 as output.Examplemysql> Select FIELD('Ram','New','Delhi'); +----------------------------+ | FIELD('Ram','New','Delhi') | +----------------------------+ |                         0  | +----------------------------+ 1 row in set (0.00 sec)

Why can't we define a static method in a Java interface?

Anjana

Anjana

Updated on 17-Jun-2020 11:36:55

From Java 8 onwards, static methods are allowed in Java interfaces.An interface can also have static helper methods from Java 8 onwards. public interface vehicle {    default void print() {       System.out.println("I am a vehicle!");    }    static void blowHorn() {       System.out.println("Blowing horn!!!");   ... Read More

How to Scroll to the top of the page using JavaScript/ jQuery?

Anjana

Anjana

Updated on 16-Jun-2020 08:16:43

ExampleLive Demo                    $("a").click(function() {             $("html, body").animate({ scrollTop: 0 }, "slow");             return false;          });             TOP OF PAGE   ... Read More

Usage of rest parameter and spread operator in JavaScript?

Anjana

Anjana

Updated on 16-Jun-2020 08:08:19

Rest ParameterWith rest parameter, you can represent a number of arguments as an array. ES6 brought rest parameter to ease the work of developers. For arguments objects, rest parameters are indicated by three dots … and precedes a parameter.Let’s see the following code snippet to define rest parameter −   ... Read More

How to create arrays in JavaScript?

Anjana

Anjana

Updated on 15-Jun-2020 07:32:09

To create an array in JavaScript, simply assign values −var animals = ["Dog", "Cat", "Tiger"];You can also use the new keyword to create arrays in JavaScript −var animals = new Array("Dog", "Cat", "Tiger");The Array parameter is a list of strings or integers. When you specify a single numeric parameter with ... Read More

How to create a blink text using JavaScript?

Anjana

Anjana

Updated on 15-Jun-2020 06:56:11

To create a blinking text, use the JavaScript blink() method. This method causes a string to blink as if it were in a BLINK tag.Note − HTML tag deprecated and is not expected to work in every browser.ExampleYou can try to run the following code to create a blinking ... Read More

How to create a small font text using JavaScript?

Anjana

Anjana

Updated on 15-Jun-2020 06:52:29

To create a small font text with JavaScript, use the small() method. This method causes a string to be displayed in a small font as if it were in a tag.ExampleYou can try to run the following code to create a small font using JavaScript −Live Demo     ... Read More

How to create a bold text using JavaScript?

Anjana

Anjana

Updated on 15-Jun-2020 06:48:12

To create a bold text using JavaScript, use the bold() text. This method causes a string to be displayed as bold as if it were in a tag.ExampleYou can try to run the following code to create a bold text with JavaScript −Live Demo           ... Read More

Advertisements