Sravani S has Published 90 Articles

Does Java support default parameter values for a method?

Sravani S

Sravani S

Updated on 16-Jun-2020 11:12:26

2K+ Views

Java does not support the concept of default parameter however, you can achieve this usingMethod overloadingUsing method overloading if you define method with no arguments along with parametrized methods. Then you can call a method with zero arguments.Variable argumentsIn Java methods parameters accept arguments with three dots. These are known ... Read More

When does a NullPointerException get thrown in java?

Sravani S

Sravani S

Updated on 16-Jun-2020 10:07:32

164 Views

A null pointer exception is thrown Whenever you try toCall the instance method of a null object.Access, modify, print, a null value.Trying to access (print/use in statements) the length of the null value.Throw a null value.Access an element of an array without initializing it.Then, a Null Pointer Exception will be ... Read More

Learning about SAP ABAP CDS views

Sravani S

Sravani S

Updated on 12-Jun-2020 12:38:57

2K+ Views

First thing, whether it is CDS or ABAP or anything pertaining to SAP, you can always find free courses on  https://open.sap.com/  referred as Open SAP. Besides this, there are lot of free help as well just Google it and the result list is huge.There are various self-learning tutorials site that ... Read More

How to search the alternate text of an image-map area in JavaScript?

Sravani S

Sravani S

Updated on 23-May-2020 11:22:37

93 Views

To search the alternate (alt) text of an image-map area in JavaScript, use the alt property. You can try to run the following code to get the alternate text.Example                                                      var x = document.getElementById("myarea").alt;          document.write("Alternate Text: "+x);          

What is the role of altKey Mouse Event in JavaScript?

Sravani S

Sravani S

Updated on 23-May-2020 09:13:53

128 Views

The altkey mouse event property is used to show whether SHIFT key is pressed or not when mouse button is clicked.ExampleYou can try to run the following code to learn how to implement altKey Mouse event in JavaScript.           Press and hold ALT key and ... Read More

What is the usage of the onbeforeunload event in JavaScript?

Sravani S

Sravani S

Updated on 21-May-2020 07:47:23

96 Views

If you want to trigger an event before the document is loaded, then use the onbeforeunload event.ExampleYou can try to run the following code to learn how to implement onbeforeunload event in JavaScript.           Click to open Qries                function myFunction() {             return "Working with onbeforeunload event";          }          

How to define a Regular Expression in JavaScript?

Sravani S

Sravani S

Updated on 19-May-2020 11:07:45

93 Views

A regular expression is an object that describes a pattern of characters.The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on the text. A regular expression could be defined with the RegExp () constructor, ... Read More

Constructor overloading in Java

Sravani S

Sravani S

Updated on 05-Mar-2020 12:22:53

5K+ Views

Yes! Java supports constructor overloading. In constructor loading, we create multiple constructors with the same name but with different parameters types or with different no of parameters.ExampleLive Demopublic class Tester {      private String message;      public Tester(){       message = "Hello World!";    }   ... Read More

How do I loop through a JSON file with multiple keys/sub-keys in Python?

Sravani S

Sravani S

Updated on 05-Mar-2020 08:14:19

12K+ Views

You can parse JSON files using the json module in Python. This module parses the json and puts it in a dict. You can then get the values from this like a normal dict. For example, if you have a json with the following content −{    "id": "file",   ... Read More

How can we do Python operator overloading with multiple operands?

Sravani S

Sravani S

Updated on 05-Mar-2020 07:32:31

231 Views

You can do Python operator overloading with multiple operands just like you would do it for binary operators. For example, if you want to overload the + operator for a class, you'd do the following −Exampleclass Complex(object):    def __init__(self, real, imag):       self.real = real     ... Read More

Advertisements