What Happens in Java Program at Compile Time

Alankritha Ammu
Updated on 13-Jun-2020 12:24:56

465 Views

During compile time, java compiler (javac) takes the source file .java file and convert it to bytecode .class file.

Yield Keyword in JavaScript

Rahul Sharma
Updated on 13-Jun-2020 12:12:12

688 Views

The yield keyword is used in JavaScript to pause and resume a generator function. The value of the expression is returned to the generator's caller.Here are the Examples −function* displayRank () {    var selPlayers= [1, 2, 3, 4];    for (var a = 0; a < selPlayers.length; a++) {       yield selPlayers[i];    } }After defining a generator function, use it like the following. HHere displayRank() is the generator function −var rank = displayRank(); // // value: 1 alert(rank.next()); // value: 2 alert(rank.next()); // value: 3 alert(rank.next()); // value: 4 alert(rank.next()); // value: undefined alert(rank.next());

What Does the Method sort(int[] a) Do in Java

Swarali Sree
Updated on 13-Jun-2020 11:56:46

124 Views

The sort(int[]) method of the java.util.Arrays class sorts the specified array of integer values into ascending numerical order.Exampleimport java.util.Arrays; public class ArrayDemo {    public static void main(String[] args) {       int iArr[] = {2, 1, 9, 6, 4};       for (int number : iArr) {          System.out.println("Number = " + number);       }       Arrays.sort(iArr);       System.out.println("The sorted int array is:");       for (int number : iArr) {          System.out.println("Number = " + number);       }    } }Output Number = 2 Number = 1 Number = 9 Number = 6 Number = 4 The sorted int array is: Number = 1 Number = 2 Number = 4 Number = 6 Number = 9

Difference Between window.load and document.ready Functions in jQuery

David Meador
Updated on 13-Jun-2020 11:54:24

4K+ Views

Both the methods are used in jQuery. Let’s see what purpose they fulfill.$(window).load()The code which gets included inside $( window ).on( "load", function() { ... }) runs only once the entire page is ready (not only DOM).Note: The load() method deprecated in jQuery version 1.8. It was completely removed in version 3.0. To see its working, add jQuery version for CDN before 3.0.$(document).ready()The ready() method is used to make a function available after the document is loaded. Whatever code you write inside the $( document ).ready() method will run once the page DOM is ready to execute JavaScript code.You can ... Read More

Why is 'class' a Reserved Word in JavaScript

Rahul Sharma
Updated on 13-Jun-2020 11:44:33

641 Views

The following are the future reserved words, which include ‘class’. These words are used as keywords in proposed extensions and are therefore reserved to allow for the possibility of future adoption of those extensions.class enum extends super const export ImportThe above is defined in the ECMAScript specification.In ECMAScript 6 Language Specification it is used. The class declaration creates a class −class name [extends] {    // body of class }

Why JavaScript var null Throws an Error but var undefined Doesn’t

Johar Ali
Updated on 13-Jun-2020 11:42:53

184 Views

The web browser throws an error for “var null” because it is a reserved identifier.You cannot use the following literals as identifiers in ECMAScript −null frue falseundefined A property with no definition. It is not known and not a reserved identifier. Its type is undefined.nullIt is known and a reserved identifier. But “null” isn’t the same as “false”. When you will declare a variable and set it to null, then null will get printed.

What is if-else if Statement in JavaScript

Krantik Chavan
Updated on 13-Jun-2020 11:41:16

418 Views

The if...else if... statement is an advanced form of if…else that allows JavaScript to make a correct decision out of several conditions.SyntaxThe syntax of an if-else-if statement is as follows −if (expression 1){    Statement(s) to be executed if expression 1 is true } else if (expression2){    Statement(s) to be executed if expression 2 is true } else if (expression3){    Statement(s) to be executed if expression 3 is true } else{    Statement(s) to be executed if no expression is true }ExampleYou can try to run the following to learn how to work with if…else if statement in ... Read More

What are Reserved Words in JavaScript

Amit Sharma
Updated on 13-Jun-2020 11:40:24

493 Views

Reserved words cannot be used as JavaScript variables, functions, methods, loop labels, or any object names.Here are the reserved words in JavaScript −abstractElseinstanceofswitchbooleanEnumintsynchronizedbreakExportinterfacethisbyteExtendslongthrowcaseFalsenativethrowscatchFinalnewtransientcharFinallynulltrueclassFloatpackagetryconstForprivatetypeofcontinueFunctionprotectedvardebuggerGotopublicvoiddefaultIfreturnvolatiledeleteimplementsshortwhileDoImportstaticwithdoubleInsuper

What is If Statement in JavaScript

Nishtha Thakur
Updated on 13-Jun-2020 11:37:20

402 Views

The if statement is the fundamental control statement that allows JavaScript to make decisions and execute statements conditionally. SyntaxThe syntax for a basic if statement is as follows −if(expression){    Statement(s)to be executed if expression is true }Here a JavaScript expression is evaluated. If the resulting value is true, the given statement(s) are executed. If the expression is false, then no statement would be not executed. Most of the times, you will use comparison operators while making decisions.ExampleYou can try to run the following to learn how to work with if statement in JavaScript −Live Demo           ... Read More

HTML DOM Parameter Object

AmitDiwan
Updated on 13-Jun-2020 10:59:14

154 Views

The HTML DOM Parameter Object represent the element of an HTML document.Create param objectSyntaxFollowing is the syntax −document.createElement(“PARAM”);Properties of param objectPropertyExplanationnameIt returns and modify the value of the name attribute of a param element in an HTML document.valueIt returns and modify the content of the value attribute of a param element in an HTML document.ExampleLet us see an example of param object − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat;       ... Read More

Advertisements