Priya Pallavi has Published 80 Articles

What is a function literal in JavaScript?

Priya Pallavi

Priya Pallavi

Updated on 20-May-2020 08:52:28

110 Views

A function literal is an expression that defines an unnamed function. You can try to run the following code to implement function literal in JavaScript.Example                                         Click the following button to call the function                          

What is a Document Object Model?

Priya Pallavi

Priya Pallavi

Updated on 18-May-2020 08:47:22

419 Views

A Document object represents the HTML document that is displayed in that window. The Document object has various properties that refer to other objects, which allow access to and modification of document content.The way a document content is accessed and modified is called the Document Object Model, or DOM. The Objects ... Read More

Connecting SAP in Ruby on Rails

Priya Pallavi

Priya Pallavi

Updated on 12-Mar-2020 12:25:33

319 Views

Try downloading nwrfcsdk library from sap and follow instructions mentioned in Readme to perform the installation. Use function Module like ENQUEUE_READ to perform remote call as below −#!/usr/bin/env ruby require 'sapnwrfc' require 'rubygems' conn = SAPNW::Base.rfc_connect(:client => '800',                         ... Read More

Java static variable

Priya Pallavi

Priya Pallavi

Updated on 06-Mar-2020 06:15:24

331 Views

The static keyword is used to create variables that will exist independently of any instances created for the class. Only one copy of the static variable exists regardless of the number of instances of the class.Static variables are also known as class variables. Local variables cannot be declared static.ExampleThe static ... Read More

How to find keith numbers using Python?

Priya Pallavi

Priya Pallavi

Updated on 05-Mar-2020 11:23:28

372 Views

You can use the following code to find if a number is a keith number in python −Exampledef is_keith_number(n):    # Find sum of digits by first getting an array of all digits then adding them    c = str(n)    a = list(map(int, c))    b = sum(a) ... Read More

Data Conversion Using valueOf() In Java.

Priya Pallavi

Priya Pallavi

Updated on 26-Feb-2020 09:53:23

96 Views

Java String class provides several variants of valueOf() method. These accept various data types and convert them into String.ExampleLive Demopublic class Sample {    public static void main(String args[]){       int i = 200;       float f = 12.0f;       char c = 's'; ... Read More

Java StringTokenizer and String Split Example.

Priya Pallavi

Priya Pallavi

Updated on 26-Feb-2020 08:26:10

807 Views

The StringTokenizer class allows an application to break a string into tokens.This class is a legacy class that is retained for compatibility reasons although its use is discouraged in new code.ExampleLive Demoimport java.util.*; public class Sample {    public static void main(String[] args) {       // creating string tokenizer ... Read More

What does the method toArray() do in java?

Priya Pallavi

Priya Pallavi

Updated on 25-Feb-2020 08:20:57

77 Views

The toArray() method of the java.util.ArrayList class returns an array containing all of the elements in this list in proper sequence (from first to the last element).This acts as a bridge between array-based and collection-based APIs.Exampleimport java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList ... Read More

What does the method add(int i, E element) do in java?

Priya Pallavi

Priya Pallavi

Updated on 20-Feb-2020 12:26:37

217 Views

The add(int index, E element) method of the java.util.ArrayList class inserts the specified element E at the specified position in this list. It shifts the element currently at that position (if any) and any subsequent elements to the right (will add one to their indices).Exampleimport java.util.ArrayList; public class ArrayListDemo { ... Read More

How to perform heapsort on an array in Java?

Priya Pallavi

Priya Pallavi

Updated on 19-Feb-2020 12:22:49

511 Views

Following is the algorithm for heapsort (maxheap).Step 1 − Create a new node at the end of the heap.Step 2 − Assign new value to the node.Step 3 − Compare the value of this child node with its parent.Step 4 − If the value of parent is less than a ... Read More

Advertisements