-
October 24th, 2011, 06:46 PM
#1
ProofRead
I would appriciate it if you'd let me know if this is foolish. Some times I seem to go off on random tangents that end up not making any sense. I would just appriciate to know if this code is headed in a sound logical direction.
post script
I formatted it so it's easy to read.
Code:
package test;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedInputStream;
import java.io.Console;
import java.util.Arrays;
import java.io.IOException;
import java.io.DataOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.EOFException;
import java.io.FileNotFoundException;
import java.nio.file.Files;
import java.lang.System;
import java.lang.String;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.FileSystemException;
import java.nio.file.InvalidPathException;
import java.nio.file.FileSystemNotFoundException;
import java.lang.IllegalArgumentException;
import java.lang.SecurityException;
import java.nio.channels.FileChannel;
import java.nio.channels.*;
import static java.nio.file.StandardOpenOption.*; // for RA
import java.nio.file.StandardOpenOption;
import java.lang.Enum;
import java.nio.file.*;
import java.nio.file.FileSystems;
import java.nio.file.Paths;
import java.nio.channels.*;
import java.nio.ByteBuffer;
import java.io.RandomAccessFile;
import java.io.RandomAccessFile.*;
import java.lang.StringBuffer;
import java.lang.Byte;
import java.io.ByteArrayInputStream;
import java.io.CharArrayWriter;
import java.util.Arrays;
import java.io.CharArrayReader;
import java.nio.CharBuffer;
import java.io.DataInputStream;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.io.StringWriter;
import java.io.Writer;
import java.io.PipedWriter;
public class Test {
public static final String file = "Test2.txt";
public static Test nObj = newObj();
// ------------------------- Ease Of Access --------------------------------------
public void write(String str) {
PipedWriter pw = new PipedWriter();
try {
pw.write(str);
}
catch(IOException ioe) {
}
}
public void soP(String print) {
System.out.println(print);
}
public void soP(int print) {
System.out.println(print);
}
public void soP(double print) {
System.out.println(print);
}
public void soP(char[] print) {
System.out.println(print);
}
public void soP(String[] print) {
System.out.println(print);
}
public void soP(float[] print) {
System.out.println(print);
}
public void soP(float print) {
System.out.println(print);
}
public void print(String s) {
if (s == null) {
s = "null";
}
write(s);
}
// ------------------------- End of E0A -------------------------------------------
public static Test newObj() {
return nObj;
}
public static void main(String[] args) throws IOException {
nObj.print(file);
}
}
Last edited by kolt007; October 24th, 2011 at 07:29 PM.
-
October 27th, 2011, 04:34 AM
#2
Re: ProofRead
You haven't told us what it is supposed to do so how can we say if it's heading in the right direction?
BTW are you sure your initialization of nObj is correct? you are calling the newobj() method which returns nObj which is not initialized yet - where are you creating the Test instance?
Last edited by keang; October 27th, 2011 at 03:45 PM.
-
October 27th, 2011, 02:11 PM
#3
Re: ProofRead
I'm trying to create a custom out.println. But, before I do that I got some reading to do.
-
October 27th, 2011, 03:44 PM
#4
Re: ProofRead
I'm trying to create a custom out.println
Why? What is your class going to do that PrintStream doesn't already do?
-
October 27th, 2011, 06:12 PM
#5
-
October 28th, 2011, 06:43 AM
#6
Re: ProofRead
What does that mean exactly.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|