Sunday, March 31, 2013

How to find files in a directory using DirectoryStream

package com.swain.cell;

import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

public class FindFilesInDirectory {
       public static void main(String[] args) {
              Path dir = Paths.get("c:\\JAVA");

              try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir,
                           "*.*")) {
                     for (Path entry : stream) {
              } catch (IOException e) {


How to Calculate the Future Investment Value of Investment.

Below java program for calculate future investment value. Here calculate s using the formula futureInvestmentValue =investmentAmount x (...