Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Have Programming Question? Ask it here!

1 Answer(s)      5 years and 7 months ago
Posted in : Java Beginners

View Answers

January 5, 2009 at 11:20 PM

Hi friend,

Please explain properly requirement. I am sending simple code according to your requirement.


public class FileRead {
public static void main(String args[]) {

FileInputStream fstream = new FileInputStream("/home/vinod/amarexamples/file2.txt");
// Get the object of DataInputStream
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
// Print the content on the console
System.out.println (strLine);
//Close the input stream
}catch (Exception e){//Catch exception if any
System.err.println("Error: " + e.getMessage());


Visit for more information.



Related Tutorials/Questions & Answers:
Ask for latest version for hibernate
Ask for latest version for hibernate  any new version for hibernate after 3.0, if yes can u give some exmp for latest version of hibernate
Ask about java
Ask about java  Create a java program for add and remove the details of a person, which is not using by database, a simply java program. If possible, please wil it in switch case
Ask about looping in database
Ask about looping in database  Good afternoon, I want to ask something, Now i have 2 tables,name of the table is RULE and Heritage. Table heritage...=True,A2=True : code is the same data Rule and Heritage. I want to ask
ask java - Date Calendar
ask java  sory i'am wrong language. i want to ask to this forum how to take calender to another frame. now we can find like "datapicker" in VB but in java i found too but i can't to join in another frame. And i want to ask how
Ask java count
Ask java count  Good morning, I have a case where there are tables sumborrowbook fieldnya: codebook, bookname, and sumborrowbook . I want to make the results: for example: | code book | name of book | sum | | b001
ask - Java Beginners
ask   dear how to "print out" into a file ? regard suhadi  Hi friend, Please explain properly requirement. I am sending simple code according to your requirement. import*; public class
Ask date difference
Ask date difference  Hello, I have a problem about how to calculate date, the result from this code is not complete , this is my code . please help me. thank you public void a(){ String date1 = jTextField33.getText(); String
ask a user to enter 5 integer
ask a user to enter 5 integer  make a program that enter 5 numbers then identify the largest and the smallest number sample program 2 4 3 5 6 the smallest number: 2 the largest number: is 6 66
Ask Questions
Ask Questions      ..., professions, students and learners, we have initiated a new service ‘Ask Question’. Using this new service, our visitors can ask any sort of question
How to ask a questions to you clearly with normal english?
How to ask a questions to you clearly with normal english?  hi, i want to know how should or can i may ask a question. send me some format... in the same way as you have asked this question. Go to the Ask Questions part
ask how function jCalender - Date Calendar
ask how function jCalender  d, Halo friend, i want to ask how to make this script can run and call JCalender. I want to know how to make private this code.i has already insert plugin in my netbeans. try
Ask JSP questions online
Ask JSP questions online       Facing problem in JSP? Ask to us, we... has just started a new problem solving service ‘ask question’. In our
How many qusetions can you ask?
How many qusetions can you ask?  Hi I was very impressed following my very first question I asked regarding some coding. However I am not sure why any further questions have not yet been answered. Is this because they are more
Ask Applet Questions Online
Ask Applet Questions Online   ... ‘Ask Questions’. Now, you can get the quick answers of your questions... service of ‘Ask Questions’ has given you the tool to resolve your
Ask Questions with Options
Ask Questions with Options using Java In this section, we are going to ask five questions one after the other with four options to test the user. For this, we have stored 5 questions, answers with four options into a list. The list
Ask PHP Questions
Ask PHP Questions       PHP Questions and Answers Ask PHP Questions and get answers from.... In your questions and answers section you can ask PHP questions and get
Ask Servlet questions online
Ask Servlet questions online       Feel free to ask any question about servlets... kicked off a new service ‘ask questions’ to resolve your query
Ask Java Questions Online
Ask Java Questions Online   ... Developer Company has just begun a new service ‘ask question online’ to resolve your query. Through using this service, you can ask
Ask make graph from i report and view to java Language Programming
Ask make graph from i report and view to java Language Programming  Dear sir, Please help me, i want to make a graph from mysql to i report and view to java. Please help me, give me example source code please. thank you
want to ask how to update data for runtime selected multiple checkboxes
want to ask how to update data for runtime selected multiple checkboxes  HI I have one problem I have fetched value from oracle database into grid and created runtime textboxes in the grid for the column geocoordsN,GeocoordsE I
ask user how many numbers to be inputted and determine the sum and highest number using an array in java
ask user how many numbers to be inputted and determine the sum and highest number using an array in java  ask user how many numbers to be inputted and determine the sum and highest number using an array in java
Ask VoIP Questions Online
Ask VoIP Questions Online   ... international calls. Ask questions to know about VoIP, or if you are facing any problem in VoIP technology, ask to us freely. Our VoIP experts
Ask Hibernate Questions Online
Ask Hibernate Questions Online   .... Feel free to ask questions on Hibernate related problems. In the move of providing you better service, we have launched a new section ‘Ask
Ask JDBC question online
Ask JDBC question online   ...-answer service ‘Ask Question in JDBC’ for all our visitors. Now you... to ask the questions from us and deploy the solution on your project
Ask iBatis Questions Online
Ask iBatis Questions Online   ... relating to programming, coding, implementing and using. Ask any iBatis question using our new service ‘Ask iBatis Questions Online’ and get
Ask Maven Questions Online
Ask Maven Questions Online   ... defined tasks such as compilation of code and its packaging. Ask any... ‘Ask Maven Questions Online’ and ease your stress. For your
Ask JEE Questions Online
Ask JEE Questions Online   ... Edition. In the latest trend, it is famous as JEE. Ask any question... or uses of J2EE. You can ask any J2EE questions online and get the most accurate
Ask SOA Questions Online
Ask SOA Questions Online   ... business tasks, or services. Ask questions pertaining to SOA by posting your query on our new services ‘Ask Questions SOA Online&rsquo
Ask EJB Questions online
Ask EJB Questions online   ... have started a new service ‘ask question on EJB online&rsquo... of enterprise applications. View and ask questions at http
Ask JavaFX Questions Online
Ask JavaFX Questions Online       Ask programming questions related to the JavaFX development. Ask if you have query about JavaFX. With the help
Ask Perl Questions Online
Ask Perl Questions Online   ... development. Ask any questions whether programming, scripting, project development, or for just learning on perl using our service ‘Ask
Ask Spring Questions Online
Ask Spring Questions Online       Spring is an open source application... of the problem on us. Post your questions online on our new service ‘Ask
Ask Dojo Questions Online
Ask Dojo Questions Online       Dojo is an open source modular JavaScript... adoption of dynamic web application development. Ask any question relating
Ask Wimax Questions Online
Ask Wimax Questions Online       Wimax refers to Worldwide Interoperability.... Ask questions regarding Wimax technology if you face any problem
Ask EAI Questions Online
Ask EAI Questions Online       Enterprise Application Integration in short... structures. Ask questions about EAI in case you face any problem
Ask Ant Questions Online
Ask Ant Questions Online       Ant or Apache Ant is an XML-based build scripting language... software available freely under Apache software license. Ask any questions
Ask Ajax Questions Online
Ask Ajax Questions Online       AJAX refers to Asynchronous JavaScript and XML.... Ask Ajax Questions online and get the correct answers immediately or within
Ask JUnit Questions Online
Ask JUnit Questions Online   .... Ask programming questions, coding problems, testing and implementing... ‘Ask JUnit Questions Online’. Our experienced and proficient JUnit
Ask XML Questions
Ask XML Questions     .... If our visitors face any sorts of problem in XML scripting, share with us. Ask... need to login and post your questions on our site under our service ‘Ask
Ask MySQL Questions online
Ask MySQL Questions online       MySQL is an open source Relational Database... initiated a new service ‘Ask Questions on MySQL’. Now you are free to ask
Ask PHP Questions online
Ask PHP Questions online   ... of problems, ask PHP Questions to us. We will solve all your queries regarding PHP. Our... that can solve all your query in fraction of second. Our ‘Ask Question
Ask DBMS Questions online
Ask DBMS Questions online       DBMS stands for Data Base Management System..., Structure Query Language (SQL), Sybase, Ingres, Ask any questions
Ask GPS Questions Online
Ask GPS Questions Online       The global Positing System (GPS... and provide accurate position of any GPS equipped system. Ask any question
Ask SQL Questions Online
Ask SQL Questions Online       Structured Query Language in short (SQL) is a standard database computer language for accessing databases. It allows
Ask Programming Questions Online
Ask Programming Questions Online       With the rapid development of technology, the numbers of softwares are also increasing and in this same proportion
Ask Struts Questions Online
Ask Struts Questions Online       Apache Struts is a standard open source framework for developing Java EE web applications. Struts uses and extends
jQuery questions - Ask jQuery questions
jQuery questions - Ask jQuery questions   ... applications. It can be used with all the web technologies frameworks. Ask your... with the code examples. So, ask and give solutions to the jQuery questions asked on our
Ask Questions on Web Services Online
Ask Questions on Web Services Online  ... our services, ask question on web services now by posting your questions on our new services ‘Ask Questions on Web Services’. If you want to develop
Ask C/C++ Questions online
Ask C/C++ Questions online   .... Just ask to us and implement our solutions in your program. Feel free to ask any... your queries. For asking your question, use our service ‘Ask