Arushi has Published 141 Articles

How to count the number of lines in a text file using Java?

Arushi

Arushi

Updated on 20-Feb-2020 05:15:24

2K+ Views

To count the number of lines in a fileInstantiate the FileInputStream class by passing an object of the required file as parameter to its constructor.Read the contents of the file to a bytearray using the read() method of FileInputStream class.Instantiate a String class by passing the byte array obtained, as a parameter its ... Read More

How to create a string from a Java Array?

Arushi

Arushi

Updated on 20-Feb-2020 04:49:12

420 Views

You can convert an array of Strings to a single array using the collect() method.ExampleLive Demoimport java.util.Arrays; import java.util.stream.Collectors; public class CreatngStringFromArray {    public static void main(String args[]) {       String [] myArray = {"Welcome", "to", "Tutorialspoint"};       String str = Arrays.stream(myArray).collect(Collectors.joining(" ")); ... Read More

How to define constants in C++?

Arushi

Arushi

Updated on 11-Feb-2020 08:08:30

732 Views

You can define constants in C++ by adding the const qualifier before the declaration of the variable. Example#include using namespace std; int main() {    const int x = 9;    x = 0;    return 0; }This will define the constant variable x. But it will throw an error ... Read More

How can I customize value, instead of NULL, of a row by using MySQL IF() function?

Arushi

Arushi

Updated on 11-Feb-2020 06:18:34

121 Views

Suppose in our ‘Employee’ table we are having NULL as the value of ‘salary’ column for two employees. The data, shown as follows, is itself not meaningful.mysql> Select * from employee; +----+--------+--------+ | ID | Name   | Salary | +----+--------+--------+ | 1 | Gaurav  | 50000  | | 2 ... Read More

What is C++ Standard Error Stream (cerr)?

Arushi

Arushi

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

5K+ Views

std::cerr is an object of class ostream that represents the standard error stream oriented to narrow characters (of type char). It corresponds to the C stream stderr. The standard error stream is a destination of characters determined by the environment. This destination may be shared by more than one standard ... Read More

How to Install C++ Compiler on Windows?

Arushi

Arushi

Updated on 10-Feb-2020 12:09:05

6K+ Views

There are several alternatives for compiling C++ on windows. Let's look at 2 of them:GCCTo install GCC on Windows you need to install MinGW. To install MinGW, go to the MinGW homepage, www.mingw.org, and follow the link to the MinGW download page. Download the latest version of the MinGW installation ... Read More

What is the resemblance of COALESCE() function with IF-THEN-ELSE statement?

Arushi

Arushi

Updated on 10-Feb-2020 08:12:53

594 Views

As we know that COALESCE() function returns first non-NULL value from the list of values. The following IF-THEN-ELSE statement is equivalent to COALESCE() function.IF value1 is not NULL THEN output = value1; ELSIF value2 is not NULL THEN output = value2; ELSIF value3 is not NULL THEN output = value3; ... Read More

What is the difference between “lang” and “type” attributes in a script tag?

Arushi

Arushi

Updated on 12-Sep-2019 08:31:25

279 Views

JavaScript lang attributeThis attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.JavaScript type attributeThis attribute is what is now recommended to indicate the scripting language in use and ... Read More

Java ResultSet getDriverMajorVersion() method with example

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

149 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 ... Read More

Java ResultSet deleteRow() method with example

Arushi

Arushi

Updated on 30-Jul-2019 22:30:26

3K+ 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 ... Read More

Previous 1 ... 5 6 7 8 9 ... 15 Next
Advertisements