Priya Pallavi has Published 68 Articles

How to use if...else statement at the command line in Python?

Priya Pallavi

Priya Pallavi

Updated on 17-Jun-2020 12:03:59

1K+ Views

There are multiple ways in which you can use if else construct in the command line in python. For example, bash supports multiline statements, which you can use like:$ python -c ' > a = True > if a: > print("a is true") > 'This will give the output:a is ... Read More

Runtime Polymorphism in Java

Priya Pallavi

Priya Pallavi

Updated on 17-Jun-2020 07:28:06

17K+ Views

Method overriding is an example of runtime polymorphism. In method overriding, a subclass overrides a method with the same signature as that of in its superclass. During compile time, the check is made on the reference type. However, in the runtime, JVM figures out the object type and would run ... Read More

How to show a nested for loop in a flow chart in JavaScript?

Priya Pallavi

Priya Pallavi

Updated on 12-Jun-2020 14:07:10

596 Views

The “for loop” includes initialization, test statement, and iteration statement. You can try to run the following code to show a nested for loop in a flow chart −

How to use labels to control the Flow in JavaScript?

Priya Pallavi

Priya Pallavi

Updated on 12-Jun-2020 13:40:11

428 Views

To control the flow in JavaScript, use labels. A label can be used with break and continue statement to control the flow more precisely. A label is simply an identifier followed by a colon (:) that is applied to a statement or a block of code. We will see two ... Read More

What is the role of parseFloat() method in JavaScript?

Priya Pallavi

Priya Pallavi

Updated on 23-May-2020 11:04:59

182 Views

Use the parseFloat() method in JavaScript to return a floating point number after parsing a string.ExampleYou can try to run the following code to learn how to work with parseFloat() method in JavaScript.                    var val1 = parseFloat("2");          var val2 = parseFloat("30 minutes");          document.write(val1);          document.write(""+val2);          

What is a Document Object Model?

Priya Pallavi

Priya Pallavi

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

752 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

553 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

Data Conversion Using valueOf() In Java.

Priya Pallavi

Priya Pallavi

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

335 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

What does the method toArray() do in java?

Priya Pallavi

Priya Pallavi

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

177 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

321 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

Advertisements