Maruthi Krishna has Published 951 Articles

What are the guide lines to be followed while using wildcards in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 08:22:22

100 Views

Instead of the typed parameter in generics (T) you can also use “?”, representing an unknown type. You can use a wild card as a −Type of parameter.Field.Local field.The only restriction on wilds cards is that you cannot it as a type argument of a generic method while invoking it.Java ... Read More

What are Unbounded wildcard w.r.t Generics method in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 08:17:35

1K+ Views

Generics is a concept in Java where you can enable a class, interface and, method, accept all (reference) types as parameters. In other words it is the concept which enables the users to choose the reference type that a method, constructor of a class accepts, dynamically. By defining a class ... Read More

What are lower-bounded wildcard w.r.t Generics method in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 08:09:36

244 Views

Generics is a concept in Java where you can enable a class, interface and, method, accept all (reference) types as parameters. In other words it is the concept which enables the users to choose the reference type that a method, constructor of a class accepts, dynamically. By defining a class ... Read More

What are upper-bounded wildcard w.r.t Generics method in Java?

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 08:01:45

278 Views

Generics is a concept in Java where you can enable a class, interface and, method, accept all (reference) types as parameters. In other words it is the concept which enables the users to choose the reference type that a method, constructor of a class accepts, dynamically. By defining a class ... Read More

Write data from/to a .csv file in java

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 06:52:18

1K+ Views

How to read/A library named OpenCSV provides API’s to read and write data from/into a.CSV file. Here it is explained how to read the contents of a .csv file using a Java program.Maven dependency    com.opencsv    opencsv    4.4    org.apache.commons    commons-lang3    3.9 The CSVReader ... Read More

Writing data from database to .csv file

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 06:47:26

4K+ Views

You can write data into a .csv file using the OpenCSV library and, you can communicate with MySQL database through a Java program using the mysql-java-connector.Maven dependencyThe following are the dependencies you need to include in your pom.xml file to write data to a .csv file from a database table. ... Read More

FileOutputStream in Java.

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 06:42:20

242 Views

This writes data into a specific file or, a file descriptor (byte by byte). It is usually used to write the contents of a file with raw bytes, such as images.To write the contents of a file using this class −First of all, you need to instantiate this class by ... Read More

Writing data to a file using BufferedWriter class in Java

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 06:37:17

727 Views

The BufferedWriter class of Java is used to write a stream of characters to the specified destination (character-output stream). It initially stores all the characters in a buffer and pushes the contents of the buffer to the destination, making the writing of characters, arrays and Strings efficient.You can specify the ... Read More

BufferedReader class in Java.

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 06:26:28

6K+ Views

The BufferedReader class of Java is used to read the stream of characters from the specified source (character-input stream). The constructor of this class accepts an InputStream object as a parameter.This class provides a method named read() and readLine() which reads and returns the character and next line from the ... Read More

What are variable arguments in java?

Maruthi Krishna

Maruthi Krishna

Updated on 12-Sep-2019 06:19:50

510 Views

While defining a method, In general, we will specify the arguments it accepts along with the type as −myMethod(int a, String b){ }Suppose if you need to accept more than one variable of the same type you need to specify the variables one after the other as −myMethod(int a, int ... Read More

Advertisements