Buffered Reader in Java Java provides several mechanism to read Files. The most useful package that is provided for this is thejava.io.Reader. This class contains the Class BufferedReader under package java.io.BufferedReader Let us see what this class has in store for us. This class reads the text
Read more →Interesting tips and tricks with the Java Date Let us first understand the parameters that consist of a Date. It will primarily contain – The year (in either 2 or 4 digits) The month (in either 2 digits, First 3 letters of the month or the entire
Read more →Working with HashMaps A HashMap basically designates unique keys to corresponding values that can be retrieved at any given point. Some core features of the HashMap are- a) The values can be stored in a map by forming a key-value pair. The value can be retrieved using
Read more →Math Simplified with Java Java has had several advanced usage application including working with complex calculations in physics, architecture/designing of structures, working with Maps and corresponding latitudes/longitudes etc. All such applications require using complex calculations/equations that are tedious to perform manually. Programmatically, such calculations, would involve usage
Read more →Let’s go Random with Java Ever wondered how these Random numbers get generated. Who sits behind this and punches in all the numbers? Well, Java does provide some interesting ways to generate random numbers, not only for gambling but also several other applications esp. related to gaming,
Read more →Using the Java timer for your programs!! Using the Java timer for your programs In Java, we have several ways of Timer implementation or rather its uses, a few of them are- Before jumping into the Timer implementation, we need to understand a few concepts like –
Read more →Let us understand Switch in Java. We all use switches regularly in our lives. Yes, I am talking about electrical switches we use for our lights and fans. As you see from the above picture, each switch is assigned to operate for particular electrical equipment. For example,
Read more →Interesting trick with For Loop – Using the Foreach loop in Java. Let us take the example using a String array that you want to iterate over without using any counters.
Read more →How to I convert a String to Integer? Let’s say you have a string – strTest – that contains a numeric value. Try to perform some arithmetic operation like divide by 4 – This immediately shows you a compilation error. Now make use of ParseInt method as
Read more →How to Split a String in Java In earlier topics, we have seen how we joined/concatenated strings, similarly we may also need to break some string based on some attributes. Mainly this attribute will be something like a separator or a common pattern with which you want
Read more →