diff --git a/java/main.java b/java/main.java new file mode 100644 index 0000000..f3701da --- /dev/null +++ b/java/main.java @@ -0,0 +1,29 @@ +import java.io.*; +public class Main { + public static void main( + String[] args) throws IOException + { + + FileInputStream sourceStream = null; + FileOutputStream targetStream = null; + + try { + sourceStream + = new FileInputStream("sourcefile.txt"); + targetStream + = new FileOutputStream("targetfile.txt"); + + int temp; + while (( + temp = sourceStream.read()) + != -1) + targetStream.write((byte)temp); + } + finally { + if (sourceStream != null) + sourceStream.close(); + if (targetStream != null) + targetStream.close(); + } + } +} \ No newline at end of file diff --git a/java/sourcefile.txt b/java/sourcefile.txt new file mode 100644 index 0000000..cf187ab --- /dev/null +++ b/java/sourcefile.txt @@ -0,0 +1,3 @@ +Object-oriented programming is a programming paradigm based on the concept of "objects", +which can contain data and code: data in the form of fields, and code, in the form of procedures. +A feature of objects is that an object's own procedures can access and often modify the data fields of itself. \ No newline at end of file