This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Rakesh Bagaria wrote:when we have FileInputStream Class for input purpose then why we need DataInputStream ?please Explain
They're different beasts, and the API tells you why. The first is for getting bytes out of files, and often this is wrapped in another IO class such as a DataInputStream to get primitives out of the file, or ObjectInputStream to get objects out, or Readers to get text, or...
While the latter is to get primitives out of a stream, any stream be it a FileInputStream, or a Stream from any other source.