Salesforce Interview Question

making sure the output for word count is correct

Interview Answers

Anonymous

Nov 1, 2010

i said i will regenerate the file with the same and number of words. if both files are of same size that means output is correct.

Anonymous

Sep 13, 2011

public boolean wordCountVerification(File file) { if (file.isFile() && file.exists()) { s File newFile = new File(file.getPath()); long fileSize = file.length(); long newFileSize = newFile.length(); if (fileSize == newFileSize ) return true; return false; } return false; }

Anonymous

Sep 8, 2012

count the number of spaces, tabs and new lines.