HashMap in Java

HashMap is one of the most used collections in Java. It is used to store key value pair. The size of HashMap increases as more key value pairs are added. Let us look at sample declaration of HashMap: HashMap<Integer,String> dummy = new HashMap<Integer,String>(); In above sample the key stored will be of type Integer and … Read more

Value of PI in Java

PI value in mathematics is a very important value used in number of formulas. In java value of PI can be obtained through Math class of java.lang package. Math.PI is a double constant whose value = 3.141592653589793 Let us look at a program to calculate area of circle using Math.PI Output