In java programming language, String is most widely used class. In certain situations we need to convert String to stream and vice versa. One such scenario is while reading data from a file, we have to convert stream to String. In this blog, we will see how to convert String to Stream and vise versa.You can learn more about String and other classes related with String like StringBuffer and StringBuilder in detail in String in java, StringBuffer in java and StringBuilder in java. Read the rest of this entry »
In Java programming, developers often comes in the situation where they have to convert String into different datatype like int, double, boolean and so on. In previous blog, we have written how one can convert String to int in java. Here in this blog we will see how to convert String to boolean in java. Read the rest of this entry »
Java provides many built-in exception but at many times built-in exceptions are not able to describe a certain situation. In such cases, like the built-in exception, the programmer can also create his own exception which are called user-defined exception.
One of most likely situation we seek is get keys of values from HashMap. While iterating through HashMap, there might be different scenarios as how mapping of key to value is done.
We’ll discuss and see how we can get key/s of value/s of below mentioned pattern-
- Key to Value: Many to One (Many keys with same value)
- Key to Value: One to One (Every Key has unique value)