Nancy Den has Published 335 Articles

Explain the ODBC architecture?

Nancy Den

Nancy Den

Updated on 26-Jun-2020 10:39:16

1K+ Views

ODBC architecture consists of the following components.Application: An application which communicates with the databases using ODBC functions is an ODBC application.ODBC driver manager: The ODBC diver manager manages the underlying drivers in an application. Whenever an application calls a function of ODBC API to communicate with a database, the driver ... Read More

Java Program to fill elements in a float array

Nancy Den

Nancy Den

Updated on 26-Jun-2020 07:27:32

168 Views

Elements can be filled in a float array using the java.util.Arrays.fill() method. This method assigns the required float value to the float array in Java. The two parameters required are the array name and the value that is to be stored in the array elements.A program that demonstrates this is ... Read More

Assertions in Java

Nancy Den

Nancy Den

Updated on 26-Jun-2020 06:51:31

6K+ Views

An assertion is a statement in Java which ensures the correctness of any assumptions which have been done in the program. When an assertion is executed, it is assumed to be true. If the assertion is false, the JVM will throw an Assertion error. It finds it application primarily in ... Read More

How to catch an assertion error in Java

Nancy Den

Nancy Den

Updated on 25-Jun-2020 15:15:15

6K+ Views

In order to catch the assertion error, we need to declare the assertion statement in the try block with the second expression being the message to be displayed and catch the assertion error in the catch block.Let us see a program on how to handle Assertion Error in Java −Examplepublic ... Read More

Replace '*' with '^' with Java Regular Expressions

Nancy Den

Nancy Den

Updated on 25-Jun-2020 15:01:20

2K+ Views

To replace *' with '^' using Java Regular Expressions, we need to use the replaceAll() method. The replaceAll() method returns a String replacing all the character sequence matching the regular expression and String after replacement.Declaration − The java.lang.String.replaceAll() method is declared as follows −public String replaceAll(String regex, String replaced)  Let ... Read More

Replace all words with another string with Java Regular Expressions

Nancy Den

Nancy Den

Updated on 25-Jun-2020 15:00:08

3K+ Views

To replace all words with another String using Java Regular Expressions, we need to use the replaceAll() method. The replaceAll() method returns a String replacing all the character sequence matching the regular expression and String after replacement.Declaration − The java.lang.String.replaceAll() method is declared as follows −public String replaceAll(String regex, String ... Read More

Removing a Preference from a Preference Node in Java

Nancy Den

Nancy Den

Updated on 25-Jun-2020 14:58:52

289 Views

In order to remove a preference from a preference node in Java, we use the remove() method. The remove method() removes all the values associated with the specified key in the preference node.Declaration − The java.util.prefs.Preferences.remove() method is declared as follows −public abstract void remove (String key)where key is the ... Read More

Determine if a Preference Node exists in Java

Nancy Den

Nancy Den

Updated on 25-Jun-2020 14:56:28

457 Views

In order to determine the existence a preference node in Java, we use the nodeExists() method. The nodeExists() method returns a boolean value. It returns true when the specified preference node exists in the same tree as this node.Declaration − The java.util.prefs.Preferences.remove() method is declared as follows −public abstract boolean ... Read More

Generate Random Integer Numbers in Java

Nancy Den

Nancy Den

Updated on 25-Jun-2020 14:52:47

6K+ Views

In order to generate Random Integer Numbers in Java, we use the nextInt() method of the java.util.Random class. This returns the next random integer value from this random number generator sequence.Declaration − The java.util.Random.nextInt() method is declared as follows −public int nextInt()Let us see a program to generate random integer ... Read More

Convert a Queue to a List in Java

Nancy Den

Nancy Den

Updated on 25-Jun-2020 14:48:19

1K+ Views

In order to convert a Queue to a List in Java, we can create an LinkedList and pass the Queue as an argument in the parameterized constructor of an ArrayList. This can be done as follows −Queue q = new LinkedList(); List l = new ArrayList(q);The quickest way is used ... Read More

Advertisements