Jump to content


Compile


  • Please log in to reply
2 replies to this topic

#1 ashikmon

ashikmon

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 13 June 2012 - 05:45 PM

i have no problem with the following code . I am giving the code bellow. please check it out .

import java.io.*;

class ashik45{

public ashik45(){

BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));

String name=new String();

String id=new String();

try{

FileWriter fw=new FileWriter("ashik40.txt");

//BufferedWriter bw=new BufferedWriter(fw); //this line has no effect on the code . why ? .what does the code means ?

System.out.println("please enter your name");

name=bf.readLine();

System.out.println("please enter your id");

id=bf.readLine();

fw.write(name);

fw.write(id);

fw.close();

System.out.println("your data has saved successfully");

}

catch(IOException ioe){

System.out.println("io exception is found");

}

}

public static void main(String args[]){

new ashik45();

}

}

#2 nyccanuck

nyccanuck

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts

Posted 14 June 2012 - 03:19 AM

View Postashikmon, on 13 June 2012 - 05:45 PM, said:

i have no problem with the following code . I am giving the code bellow. please check it out .


BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));

FileWriter fw=new FileWriter("ashik40.txt");

//BufferedWriter bw=new BufferedWriter(fw); //this line has no effect on the code . why ? .what does the code means ?




BufferedWriter:
http://docs.oracle.c...eredWriter.html

#3 arleneangle

arleneangle

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 25 June 2012 - 02:46 AM

What you said it is very difficult.I have no idea.
Every journey begins with the first stepPosted Image