Monica Mona

Monica Mona

61 Articles Published

Articles by Monica Mona

Page 4 of 7

Clearing a Dictionary using Javascript

Monica Mona
Monica Mona
Updated on 15-Jun-2020 2K+ Views

We'll implement a clear() function that simply clears the contents of the container. For example,  Exampleclear() {    this.container = {} }You can test this using − Exampleconst myMap = new MyMap(); myMap.put("key1", "value1"); myMap.put("key2", "value2");   myMap.display(); myMap.clear(); myMap.display();OutputThis will give the output −{ key1: 'value1', key2: 'value2' }You can use the clear method in the same way in ES6 maps as well. For example, Exampleconst myMap = new Map([    ["key1", "value1"],    ["key2", "value2"] ]); console.log(myMap) myMap.clear(); console.log(myMap)OutputThis will give the output −Map { 'key1' => 'value1', 'key2' => 'value2' } Map {}

Read More

Loop through a Dictionary in Javascript

Monica Mona
Monica Mona
Updated on 15-Jun-2020 12K+ Views

Here we'll implement a for each function in our class and accept a callback that we can call on every key-value pair. Let's see how we can implement such a function − ExampleforEach(callback) {    for (let prop in this.container) {       // Call the callback as: callback(key, value)       callback(prop, this.container[prop]);    } }You can test this using − Exampleconst myMap = new MyMap(); myMap.put("key1", "value1"); myMap.put("key2", "value2"); myMap.forEach((k, v) => console.log(`Key is ${k} and value is ${v}`));OutputThis will give the output −Key is key1 and value is value1 Key is key2 and value is value2ES6 ...

Read More

What is the base class for errors and exceptions in Java?

Monica Mona
Monica Mona
Updated on 25-Feb-2020 3K+ Views

All exception classes are subtypes of the java.lang.Exception class. The Exception class is a subclass of the Throwable class. Other than the Exception class there is another subclass called Error which is derived from the Throwable class.

Read More

What is Deserialization in Java?

Monica Mona
Monica Mona
Updated on 25-Feb-2020 358 Views

After a serialized object has been written into a file, it can be read from the file and Deserialized that is, the type information and bytes that represent the object and its data can be used to recreate the object in memory.Exampleimport java.io.*; public class DeserializeDemo {    public static void main(String [] args) {       Employee e = null;       try {          FileInputStream fileIn = new FileInputStream("/tmp/employee.ser");          ObjectInputStream in = new ObjectInputStream(fileIn);          e = (Employee) in.readObject();          in.close(); ...

Read More

Which method must be implemented by all threads in Java?

Monica Mona
Monica Mona
Updated on 25-Feb-2020 1K+ Views

While creating a thread class we must override the run() method of the Thread class. This method provides an entry point for the thread and you will put your complete business logic inside this method.Exampleclass ThreadDemo extends Thread {    private String threadName;    ThreadDemo( String name) {       threadName = name;       System.out.println("Creating " +        threadName );    }    public void run() {       System.out.println("Running " +          threadName );       try {          for(int i = 4; i ...

Read More

SAP interfaces throws an error message "Completion Code 2, Reason 2161, MQJMS2002”

Monica Mona
Monica Mona
Updated on 24-Feb-2020 247 Views

As per my understanding,  the only way to get the MQ jar files or the MQ C/C++ library files onto a system is by installing any of the below:Using WebSphere MQ product orUsing WebSphere MQ Client SupportPacsYou can find jar file under WebSphere MQ V7.0 Clients SupportPacks. The install files are commonly available under java/lib directory.You can try installing jar files from Fix Central. Go to Fix Central and enter "Java" in the Text search box.https://www-945.ibm.com/support/fixcentral/swg/identifyFixes?query.parent=ibm~WebSphere&query.product=ibm~WebSphere~WebSphere%20MQ&query.release=9.0&query.platform=AllThe name of the file to be downloaded is in this format:-[IBM|WS]-MQ-Install-Java-All.jar.For example, for MQ V9.0:9.0.0.0-IBM-MQ-Install-Java-All.jar.You have the following files that can be moved to ...

Read More

What is length in Java Arrays?

Monica Mona
Monica Mona
Updated on 19-Feb-2020 749 Views

Length is a filed in java, it gives the total number of the elements in a Java array. The length of an array is defined after the array was created.Integer[] myArray = {23, 93, 56, 92, 39}; System.out.println(myArray.length);

Read More

How many ways can get the instance of a Class class in Java?

Monica Mona
Monica Mona
Updated on 18-Feb-2020 635 Views

You can create an object of the class named Class in two ways −Using new keyword as −Class obj = new Class();Using the forName() method of the class named Class.Class obj = Class.forName("DemoTest");

Read More

Making an SAP ABAP program to wait

Monica Mona
Monica Mona
Updated on 18-Feb-2020 2K+ Views

You can use WAIT to hold the program for few seconds. Here is the syntaxSyntaxWAIT UP TO 36 SECONDSHowever, you need to be careful about using it. WAIT does an implicit commit. So you need to be sure that the commit does not corrupt the database. It also releases the work process.An alternative is to use below code −CALL FUNCTION 'ENQUE_SLEEP'       EXPORTING          seconds = 36.

Read More

Can we create multiple database in SAP HANA system?

Monica Mona
Monica Mona
Updated on 17-Feb-2020 466 Views

In SAP HANA, you don’t have a concept of creating multiple databases in one container. To create a separate container for your database objects, you can create the schema in HANA db.To create a schema, you can use below SQL query −CREATE SCHEMA schema nameYou can also define as owner name while defining a schema.CREATE SCHEMA [OWNED BY ]If it is not defined, the system takes the current user as the owner of the schema.

Read More
Showing 31–40 of 61 articles
Advertisements