Priya Pallavi has Published 70 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

14K+ 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

468 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

278 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

128 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

477 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

373 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

How to find keith numbers using Python?

Priya Pallavi

Priya Pallavi

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

485 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

145 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

884 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

Advertisements