Govinda Sai has Published 74 Articles

How to remove a specific element from a JSON Array in Java?

Govinda Sai

Govinda Sai

Updated on 19-Feb-2020 12:25:46

12K+ Views

You can remove an element from the JSONArray object using the remove() method. This method accepts an integer and removes the element in that particular index.Exampleimport org.json.JSONArray; public class RemoveFromJsonArray {    public static void main(String args[]) throws Exception {       String [] myArray = {"JavaFX", "HBase", "JOGL", ... Read More

How to read a 2d array from a file in java?

Govinda Sai

Govinda Sai

Updated on 19-Feb-2020 11:20:12

9K+ Views

A 2d array is an array of one dimensional arrays to read the contents of a file to a 2d array –Instantiate Scanner or other relevant class to read data from a file. Create an array to store the contents.To copy contents, you need two loops one nested within the other. ... Read More

How to find the Odd and Even numbers in an Array in java?

Govinda Sai

Govinda Sai

Updated on 19-Feb-2020 10:54:29

2K+ Views

In the loop check, the result of i%2 operation on each element if 0 the element is even else the element is odd.ExampleLive Demopublic class OddNumbersInAnArray {    public static void main(String args[]) {       int[] myArray = {23, 93, 56, 92, 39};       System.out.println("Even numbers in the given array are:: ");       for (int i=0; i

Using method getBPLIST() to get list of all orders in SAP Business One

Govinda Sai

Govinda Sai

Updated on 14-Feb-2020 10:01:47

397 Views

I would suggest using recordset with DI API −SAPbobsCOM.Recordset rs = ((SAPbobsCOM.Company)oCompany.GetDICompany()).GetBusinessObject(BoObjectTypes.BoRecordset); rs.DoQuery("SELECT DocEntry, DocNum, DocDate, TaxDate, CardCode, CardName, DocTotal    FROM OPOR ORDER BY DocDate ASC"); while (!rs.EoF) {    int DocEntry = rs.Fields.Item("DocEntry").Value;    //OR    DocEntry = rs.Fields.Item(0).Value;    rs.MoveNext(); }Read More

When to use virtual destructors in C++?

Govinda Sai

Govinda Sai

Updated on 11-Feb-2020 11:05:48

650 Views

Scott Meyers in Effective C++ says −If a class has any virtual function, it should have a virtual destructor, and that classes not designed to be base classes or not designed to be used polymorphically should not declare virtual destructors.So you should declare destructors virtual in polymorphic base classes. This ... Read More

Compound Assignment Operators in C++

Govinda Sai

Govinda Sai

Updated on 11-Feb-2020 05:10:31

3K+ Views

The compound assignment operators are specified in the form e1 op= e2, where e1 is a modifiable l-value not of const type and e2 is one of the following −An arithmetic typeA pointer, if op is + or –The e1 op= e2 form behaves as e1 = e1 op e2, ... Read More

What is sizeof operator in C++?

Govinda Sai

Govinda Sai

Updated on 10-Feb-2020 13:17:17

318 Views

The sizeof is a keyword, but it is a compile-time operator that determines the size, in bytes, of a variable or data type. The sizeof operator can be used to get the size of classes, structures, unions and any other user-defined data type. The syntax of using sizeof is as ... Read More

How can we upload the changed value, rather than written in a text file, of column(s) while importing that text file into MySQL table?

Govinda Sai

Govinda Sai

Updated on 06-Feb-2020 05:58:41

66 Views

Suppose if we want to upload the changed value rather than the value written in a text file then we need to use user variables along with the SET command. It can be understood with the help of the following example −ExampleSuppose we are having the following data in ‘A.txt’ ... Read More

Usage of letter-spacing property in CSS

Govinda Sai

Govinda Sai

Updated on 31-Jan-2020 06:21:35

69 Views

The letter-spacing property is used to add or subtract space between the letters that make up a word. Possible values are normal or a number specifying space.                            This text is having space between letters.          

Change the font face with CSS

Govinda Sai

Govinda Sai

Updated on 30-Jan-2020 09:23:13

257 Views

To change the font face, use the font-family property.ExampleYou can try to run the following code to learn how to work with the font-family property:                            Demo content          

Advertisements