First I would like to introduce myself. I am Francince and I am software programmer by profession. I am an expert on most of the major languages being used today such as C, Java, Python, etc. However, I consider myself as a hardcore java programmer. I love this language. Don't get me wrong, I also know how to program on those new softwares that is Java base such as TIBCO, weblogic, websphere. Nowadays, Java is a must to learn since most companies relies on readily made platform. Most if not all are fundamentally based on java. Java became a strong language because it supports various technologies, be that XML, DB, API, etc; java provides support to all of that.
I am a little bit tired of working in the office so one day it kept me thinking why would I not start a blog. I can do better than these guys since I know most of the basic fundametals of java language. Once you are in a corporate world there would come a time that you have to find some things to do other than work. Speaking of which, have you guys played the latest craze right now? I know that you know what I am talking about. It's Pokemon Go. It's crazy. It's a hype. Nonetheless the game is very exciting however I just don't have the luxury of time to play it. Well I am not gonna say that I will not play it, at least for now.
Moving on.
What can you expect on this blog site?
I will give a detailed explanation of the usage and examples of the basic API of java Language Specification
I will provide detailed method examples for each of the methods available on each class
All of the examples that will be provided are useful and applicable in real life applications
My approach is very simple. I will concentrate on one class that is available in Java. And then I will provide example on each constructor.
Let's discuss first What is Java Scanner? The Scanner class as of Java 1.5 is one of the basic class to handle reading and tokening streams and files Before Java 1.5, in order to readfile line by line, we are using the BufferedReader and similar classes(Tip: Those classes in java.util package that is a subclass of Reader) to do so. It's quite painful because the methods available are not user friendly. Honestly speaking, I used the Scanner class a lot especially in dealing with reading of files. It's ease of use and powerful method, makes this class popular.
For simplicity let's take an example on how to read a file line by line:
Scanner scan = new Scanner(new File("/tmp/sample.txt"));
while(scan.hasNextLine()){
System.out.println(s.nextLine());
}
Pretty simple isn't it. The example above make use of the constructor of Scanner class that takes a File object as an input. As you move along, you will find other contructors available that are very useful such as InputStream.
I am a little bit tired of working in the office so one day it kept me thinking why would I not start a blog. I can do better than these guys since I know most of the basic fundametals of java language. Once you are in a corporate world there would come a time that you have to find some things to do other than work. Speaking of which, have you guys played the latest craze right now? I know that you know what I am talking about. It's Pokemon Go. It's crazy. It's a hype. Nonetheless the game is very exciting however I just don't have the luxury of time to play it. Well I am not gonna say that I will not play it, at least for now.
Moving on.
What can you expect on this blog site?
I will give a detailed explanation of the usage and examples of the basic API of java Language Specification
I will provide detailed method examples for each of the methods available on each class
All of the examples that will be provided are useful and applicable in real life applications
My approach is very simple. I will concentrate on one class that is available in Java. And then I will provide example on each constructor.
Let's discuss first What is Java Scanner? The Scanner class as of Java 1.5 is one of the basic class to handle reading and tokening streams and files Before Java 1.5, in order to readfile line by line, we are using the BufferedReader and similar classes(Tip: Those classes in java.util package that is a subclass of Reader) to do so. It's quite painful because the methods available are not user friendly. Honestly speaking, I used the Scanner class a lot especially in dealing with reading of files. It's ease of use and powerful method, makes this class popular.
For simplicity let's take an example on how to read a file line by line:
Scanner scan = new Scanner(new File("/tmp/sample.txt"));
while(scan.hasNextLine()){
System.out.println(s.nextLine());
}
Pretty simple isn't it. The example above make use of the constructor of Scanner class that takes a File object as an input. As you move along, you will find other contructors available that are very useful such as InputStream.