How to read file in Java using Scanner Example - text files

Reading file with Scanner
From Java 5 onwards java.util.Scanner class can be used to read file in Java. Earlier we have seen example of reading file in Java using FileInputStream and reading file line by line using BufferedInputStream and in this Java tutorial we will See How can we use Scanner to read files in Java. Scanner is a utility class in java.util package and provides several convenient method to read int, long, String, double etc from source which can be an InputStream, a file or a String itself. As noted on How to get input from User, Scanner is also an easy way to read user input using (InputStream) as source.Main advantage of using Scanner for reading file is that it allows you to change delimiter using useDelimiter() method, So you can use any other delimiter like comma, pipe instead of white space.

What is difference between View and Materialized View in Database or SQL?

Difference between View and Materialized view is one of the popular SQL interview questions, much like truncate vs delete, correlated vs noncorrelated subquery or primary key vs unique key. This is one of the classic questions which keeps appearing in SQL interview now and then and you simply can’t afford to learn about them. Doesn’t matter if you are a programmer, developer or DBA, these SQL questions are common to all. Views are a concept which not every programmer familiar of, it simply not in the category of CRUD operation or database transactions or SELECT query, its little-advanced concept for the average programmer.

What is the cost of Oracle Java Certifications - OCAJP8, OCPJP8, OCEWCD, OCMJEA?

One of the frequently asked questions about Oracle Java certifications, formerly known as Sun Certified Java programmer e.g. OCAJP, OCPJP, OCEWCD, OCMEJA etc is about the cost of certification. Many of my readers often ask what is the cost of OCAJP8 or OCPJP8? Is there any discount available? What are the fees of Java 8 certifications? how much Java architect exam cost? etc. I have answered many of them one to one via Facebook and Email in the past, but after so many such requests, I decided to write a blog post about it.

Difference between == and equals() method in Java - String Object

What is the difference between == and equals() method for comparing Objects in Java is one of the classical Interview Questions which appears now and then in many interviews? This question is mostly asked in conjunction with String because comparing String using == and equals() method returns different results. I have often seen along with other popular String  question e.g. StringBuffer vs StringBuilder, Why String is final etc.  Java is a pure object-oriented language and every object has one state and location in the memory and equals () and == are related to the state and location of the object, now in this article will try to understand this concept and difference between == and equals method in Java.