Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Complete IIT AIEEE ICSE ISC PMT help forum

Complete help forum for students preparing for icse iit aieee cbse pmt and other related exams.Stay updated about all 2011 exams.
 
HomeHome  PortalPortal  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  India NewsIndia News  
Keywords
physics ICSE prelim 2010 papers CLASS paper question 2004 CASE SELECT 2006 graph science RESULT computer 2007 UNION 2009 YEAR
Latest topics
» Nitration of aniline - IIT JEE 2018 Advanced - solved
Basic File handling program in java with Output/input Stream EmptyFri Jun 08, 2018 2:34 am by adianadiadi

» Diamagnetic - Paramagnetic - Ni(CO)4, [Ni(CN)4]2- and [NiCl4
Basic File handling program in java with Output/input Stream EmptyFri Apr 06, 2018 1:05 am by adianadiadi

» IIT JEE chemistry solved interactive question paper
Basic File handling program in java with Output/input Stream EmptySun Oct 29, 2017 12:11 pm by adianadiadi

» IIT JEE 2015 SOLVED QUESTION PAPER
Basic File handling program in java with Output/input Stream EmptyWed Oct 19, 2016 1:44 pm by adianadiadi

» IIT JEE chemistry solved questions
Basic File handling program in java with Output/input Stream EmptySat Jul 18, 2015 6:15 pm by adianadiadi

» General Description of Chinese Market for Foaming Agent ADC
Basic File handling program in java with Output/input Stream EmptyFri May 09, 2014 2:09 pm by happybaicaitou

» How to get Lowest Cost MBBS Admission?
Basic File handling program in java with Output/input Stream EmptyMon Feb 24, 2014 6:39 pm by MENTOR 2014

»  girl boy vashikaran specialist agori baba ji +91-9461165
Basic File handling program in java with Output/input Stream EmptyTue Jan 21, 2014 6:00 pm by krshastri

»  STRONG LOST LOVE SPELL +91-9461165176
Basic File handling program in java with Output/input Stream EmptyTue Jan 21, 2014 6:00 pm by krshastri

Top posters
abhas
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
Anu..i luv icse...:)
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
G-7
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
siya
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
Candy
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
jOhNy
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
Apurva
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
WinRrule
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
ambili
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 
saif
Basic File handling program in java with Output/input Stream Vote_lcapBasic File handling program in java with Output/input Stream Voting_barBasic File handling program in java with Output/input Stream Vote_rcap 



Search if you can't find it here

Basic File handling program in java with Output/input Stream

View previous topic View next topic Go down
AuthorMessage
abhas
Active member
Active member
abhas


Basic File handling program in java with Output/input Stream Vide
PostSubject: Basic File handling program in java with Output/input Stream Basic File handling program in java with Output/input Stream EmptySat Jun 27, 2009 6:14 pm

import java.io.*;


class fileH
{
public static void main(String args[])throws IOException
{
BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter a number of elements");
int n=Integer.parseInt(obj.readLine());

FileOutputStream fos=new FileOutputStream("Stu.dat");
DataOutputStream dos=new DataOutputStream(fos);
for(int a=0;a<n;a++)
{

System.out.println("Enter serial number");
int c=Integer.parseInt(obj.readLine());
System.out.println("Enter Name");
String N=obj.readLine();
dos.writeInt(c);
dos.writeUTF(N);

}

fos.close();
dos.close();

FileInputStream fis=new FileInputStream("Stu.dat");
DataInputStream dis=new DataInputStream(fis);
while(dis.available()!=0)
{

int d=dis.readInt();
String e=dis.readUTF();
System.out.println(d+" "+e);
}

fis.close();
dis.close();
}
}
Back to top Go down

Basic File handling program in java with Output/input Stream

View previous topic View next topic Back to top
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Complete IIT AIEEE ICSE ISC PMT help forum :: ISC :: ISC 2010 [Class xii] :: Computer-