Arushi

Arushi

86 Articles Published

Articles by Arushi

Page 9 of 9

Java ResultSet getMetaData() method with example

Arushi
Arushi
Updated on 30-Jul-2019 7K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ResultSet object has a cursor/pointer which points to the current row. Initially this cursor is positioned before first row.The ResultSetMetaData provides information about the obtained ResultSet object like, the number of columns, names of the columns, datatypes of the columns, name of the table etc…The getMetaData() method of ResultSet interface ...

Read More

Python program to convert an array to an ordinary list with the same items

Arushi
Arushi
Updated on 30-Jul-2019 215 Views

The array is given. Our task is to convert an array to an ordinary list. We solve this problem with the help of tolist() function. This function return the array as a (possibly nested) list. Algorithm Step 1: Given an array. Step 2: convert the array to a list using tolist() function. Step 3: Display list Example Code #Python program to convert an array to an ordinary #list with the same items from array import * def arraytolist(A): lst = A.tolist() # list print("The List Is ::>",lst) # Driver code A= array('i', [20,30,60]) # array arraytolist(A) Output The List Is ::> [20, 30, 60] The List Is ::> [20, 30, 60]

Read More

Python program to find k'th smallest element in a 2D array

Arushi
Arushi
Updated on 30-Jul-2019 560 Views

One n×n user input integer matrix is given and the value of k. Our task is to find out k'th smallest element in a 2D array. Here we use heapq mudule.Heap queue (or heapq) in Python. In Python, it is available using “heapq” module. The technique of this module in python is that each time the smallest of heap element is popped (min heap).nsmallest () method is used to get n least values from a data frame or a series. Example Input Array is:: 10 20 20 40 15 45 40 30 32 33 30 50 ...

Read More

Python program to check whether two lists are circularly identical

Arushi
Arushi
Updated on 30-Jul-2019 832 Views

Here two lists are given. Our task is to check and found weather two given lists are circularly identical or not. Example Input : A = [100, 100, 10, 10, 100] B = [100, 100, 100, 10, 10] Output : True Explanation True as when these elements in the list will circularly rotate then they would be similar to other given list Algorithm Step 1: Create First and Second List. Step 2: Then Lists are converted to map. Step 3: join () method is used for converting the ...

Read More

Global variables in Java

Arushi
Arushi
Updated on 30-Jul-2019 1K+ Views

There is no global variables support in Java. Static variables can be used as an alternate solution for global variables.

Read More

Can access modifiers be used for local variables in Java?

Arushi
Arushi
Updated on 30-Jul-2019 872 Views

Yes, a local variable can be public, private, protected or default.

Read More
Showing 81–86 of 86 articles
« Prev 1 5 6 7 8 9 Next »
Advertisements