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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pandu
input output
1 Answer(s)      4 years ago
Posted in : Java Beginners


java program using fileinputstream and fileoutputstream


Advertisement
View Answers

January 7, 2011 at 10:40 AM


Hi Friend,

Try the following code:

import java.io.*;
class FileInputStreamAndFileOutputStream
{
    public static void main(String[] args) throws Exception {
      FileInputStream in = new FileInputStream("c:/hello.txt");
      FileOutputStream out = new FileOutputStream("C:/data.txt");
      int c;
      while ((c = in.read()) != -1) {
        out.write(c);
      }
      out.close();
      System.out.println("File is copied");
    } 
    }

Thanks



Related Tutorials/Questions & Answers:
input output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part...*; package, which is required for any input/output operations. Classes Defined
input output
input output  java program using fileinputstream and fileoutputstream   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args
Advertisements
input output
input output  java program using fileinputstream and fileoutputstream   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args
Data input & output Stream
Data input & output Stream  Explain Data Input Stream and Data Output Stream Class.   DataInputStream and DataOutputStream A data input stream lets an application read primitive Java data types from an underlying input
Input and Output package
Input and Output package  Hi guys, My professor used input and output... she used in.readint() out.writeln() commands to read input and print output. she created two new objects directly to use this statements. /* input and output
input output in java
input output in java  java program using filereader and filewriter   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args) throws
Input And Output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part of java.io..., which is required for any input/output operations. Classes Defined in the program
Input / Output in Easiest Method in Java
Input / Output in Easiest Method in Java  How to input from keyboard, both strings and characters and display the result on the screen...)throws Exception{ Scanner input=new Scanner(System.in
Input and Output problems - Java Beginners
Input and Output problems  1) what is Difference between InputStreamReader and FileReader? 2) what is buffer?   Hi friend... to a particular platform. Thus, this class reads characters from a byte input stream
counting the values in input file and and writing the output to a file
counting the values in input file and and writing the output to a file ... it should write the output to a file. Input file has 20 rows and 4 columns. If we...-code/16483-counting-values-input-file-writing-output-file.html this code
Java Input/Output Examples
Java Input/Output Examples In this tutorial you will learn about how the Inputs and outputs are managed in java. To understand the Java Input & Output... and interfaces to handle the system input & output through data streams
Input - Output String Functions
Input - Output String Functions      ... a string data and input them directly into your database. Some special characters...); ?> Output: Actual string is:rose'india After adding slash it become:rose
Working With File,Java Input,Java Input Output,Java Inputstream,Java io Tutorial,Java io package,Java io example
; Output of the Program C:\nisha>javac CreateFile1.java C... will see a message as shown in the output. C:\nisha>javac
output
output  Sir,I am experiencing some problems with the output of this program.I got some useful help this website,but the output of the program isn't producing what it should.let me explain the output below is what happen when
input
input  a java program that will exchange the last names of two students that were input by a user
output error
]; for (k=0;k } } if i enter "my name" as the input the output...output error  this is my program import java.io.*; public class separate { public static void main(String[] args)throws IOException
input box
input box  give me the code of input box in core java
input box
input box  give me the code of input box in core java
Output of flex
Output of flex  hi....... please provide the name of the output file. What is the output of flex applications? please rply ASAP........ Thanks
triangle output
triangle output  program to get the following output
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly. Thanks
output of the program
output of the program  public static int sum(List list) { int sum = 0; for ( Iterator iter = list.iterator(); iter.hasNext(); ) { int i = ((Integer)iter.next()).intValue(); sum += i; } return sum
What is the output if....
What is the output if....  Here is my code. what is the output...");   When we put 50 as a lower limit value, output comes: Entering... as a lower limit value, output comes: Entering the try block. Exiting the try block
What will be the Output?
What will be the Output?  int[] number = {5,3,6,10,1} int temp; for (int i=0; inumbers[j]) { temp=numbers[i]; numbers[i]=numbers[j] number[j]=temp
Array and input
to input one of the above numbers then i want to print the array without the number user input. how will i do tht
xml output
xml output  generate an xml output in the following format <FileCount> <DOC>AA <RTF>BB <PDF>CC <Total>DD where AA=total number of .DOC files found BB=total number of .RTF files found,etc
what will the output
= (Parent) sonu; p.play(); What will be the output of above section of code
what is the output?
what is the output?  public class MyAr{ public static void main(String argv[]) { int[] i=new int[5]; System.out.println(i[5]); } }   It gives ArrayIndexOutOfBoundsException as you haven't add element to array. Correct
keyboard input
keyboard input  how do I use JOptionPane to accept keyboard input? I know how to import but not specific command on input line   import javax.swing.*; class JOPtionPaneExample { public static void main(String
how to get following output
how to get following output  input 123456 output 1 2 3 4 5 6
how to get following output
how to get following output  input 123456 output 1 2 3 4 5 6
Advertisements
 

 

 

DMCA.com