displaying total lines read from Map
<p>I have the application in which user select the particular folder and all the files in that folder along with the line of code in those individual files is counted and at the console along with the file names and the line of code in to them is displayed ..here is my piece of code ... </p>

<pre><code>Map&lt;String, Integer&gt; result = new HashMap&lt;String, Integer&gt;();  
                File directory = new File(chooser.getSelectedFile().getAbsolutePath());   
                File[] files = directory.listFiles();  
                for (File file : files)  
                {  
                    if (file.isFile())  
                    {    Scanner scanner = new Scanner(new FileReader(file));  
                        int lineCount = 0;  
                        try  
                        { for (lineCount = 0; scanner.nextLine() != null; lineCount++) ;  
                        } catch (NoSuchElementException e)  
                        {   result.put(file.getName(), lineCount);  
                        }  
                    }  
                }  
                for (Map.Entry&lt;String, Integer&gt; entry : result.entrySet())  
                {   System.out.println(entry.getKey() + " ==&gt; " + entry.getValue());  
                }  }  
</code></pre>

<p>but I want to add one more functionality it should also display total lines of all the files lets assume those 6 individual files have 10 piece of line of code each have then sum of lines is 10*6 that is 60 total lines read, how to achieve this please advise</p>
