Output:
#1 double colon notation ::
The new double colon (::) operator that Java 8 has to convert a normal method into lambda expression. So,
Instead of:
You can do:
#2 Why is stream::iterator used?
…
Output:
#1 double colon notation ::
The new double colon (::) operator that Java 8 has to convert a normal method into lambda expression. So,
Instead of:
You can do:
#2 Why is stream::iterator used?
…
Q1. What is the purpose of Java I/O System? A1. The purpose is to provide an abstraction for all types of I/O like memory, file, directory, network, and pipe. Pipes in Java IO provides the ability for two threads running in the same JVM to communicate with each other. …...
Q1. What are the key considerations in processing large files?
A1. Before jumping into coding, get the requirements.
#1 Trade-offs among CPU, Memory Usage & Disk I/O
Processing a file involves reading from the disk, processing (e.g. parsing an XML and transforming), and writing back to the disk.
…
Q1. What are the different data sizes, and what technologies can be used to process them? A1. In general, data sizes can be classified as shown below. 1) Small size data is < 10 GB in multiple files. … Read more ›...
If you want to process medium sized data (e.g. 2 GB to 100 GB in multiple files) in Java, consider writing a batch job with Spring batch or Java EE 7.0 batch processing. If processing requires access to other systems, use “spring integration” … Read more ›...
File to read: src/main/resources/examples/request.xml
1. Using Java API without any libraries
You can also use the “ClassLoader”
2. Using Java 7 NIO
3.
…
As a Java developer it is a very common task to read file contents to a String object. It is also very common in pre-interview written tests read the contents of a file and apply regex to split string, etc.
4 things to watch-out for in File processing
1) Files must be closed once read.
…
Q1. Why & when do you want to use properties files for the project configuration as opposed to Java constants?
A1. It is a best practice to externalize application related properties that are likely to change. If you hard code the properties that are likely to change,
…