• Post Reply Bookmark Topic Watch Topic
  • New Topic

about SCJP test  RSS feed

qunlbao leon
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
these days I have done a lot of tests,some tests
include a lot of questions about awt,io. I am very afraid of these questions,who can tell me how many questions are about awt or io in real exam?
R K Singh
Ranch Hand
Posts: 5390
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there are enough question to lower ur percentage.
I got 5-6 on IO and 4-5 on AWT
but not to worry ... AWT and IO are easy .... like u I was also very much afraid with these topics... but once u start then every thing become clear.
Read only what is written in Certification objective. u can get certi objective at sun site.
For IO first just try to remember hierarchy of InputStream and Reader. O/p and writer is almost same. Then some methods... things will be clear..
For AWT .. u should know all the events and there interfaces and there adapter classes they are just 10-11(and all are almost same..)
For IO I have one MS-doc file but I can not post fiiles here .... just ctrl+A , ctrl+C, Ctrl+V
I/O Classes
oInputStream (Abstract)
oFilterInputStream (Filter Classes)
oDataInputStream (implements java.io.DataInput)
oObjectInputStream (implements java.io.ObjectInput,
oStringBufferInputStream Deprecated
OutputStream is same but does not have Pushback, LineNumber classes.
And has one additional class PrintStream.
oReader (Abstract)
Writer does not has Pushback, LineNumber classes.
And has one additional class PrintWriter.
oPrintWriter (derived from Writer)
Classes Which deals with File:
FileRandom AccessFile
FileInputStreamFileReader(These have classes use Stream) FileOutputStreamFileWriter
I/O Constructors
InputStream AbstractClass
�ByteArrayInputStream (byte[ ] buf) ByteArrayOutputStream( )
ByteArrayInputStream (byte[ ] buf, int offset, int length) ByteArrayOutputStream(int size)
�FileInputStream(File file) FileOutputStream(File file) throws FileNotFoundException
FileInputStream(String name) FileOutputStream(String name)
throws FileNotFoundException
�FileOutputStream(String name, boolean append) throws FileNotFoundException
FileInputStream(FileDescriptor fdObj)FileOutputStream(FileDescriptor fdObj)
-FileDescriptor represents an existing connection to an actual file
�FilterInputStream(InputStream in) FilterOutputStream (OutputStream out)
�BufferedInputStream(InputStream in) BufferedOutputStream(OutputStream out)
BufferedInputStream(InputStream in, int size)BufferedOutputStream(OutputStream out, int size)
�DataInputStream(InputStream in) DataOutputStream(OutputStream out)
�PushbackInputStream(InputStream in)
PushbackInputStream(InputStream in, int size)
�LineNumberInputStream(InputStream in)
�PrintStream(OutputStream out)
PrintStream(OutputStream out, boolean autoFlush)
�ObjectInputStream ()ObjectOutputStream( )
ObjectInputStream (InputStream in) ObjectOutputStream(OutputStream out)
PipedInputStream(PipedOutputStream src) PipedOutputStream(PipedInputStream snk)
�SequenceInputStream(Enumeration e)
SequenceInputStream(InputStream s1, InputStream s2)
�StringBufferInputStream(String s) Deprecated

Reader/Writer Constructor
Reader Abstract
�BufferedReader (Reader in) BufferedWriter (Writer out)
BufferedReader (Reader in, int sz)BufferedWriter (Writer out, int sz)
�LineNumberReader (Reader in)
LineNumberReader (Reader in, int sz)
�CharArrayReader (char[] buf)CharArrayWriter()
CharArrayReader (char[] buf, int offset, int length)CharArrayWriter(int initialSize)
FilterReader (Reader in) FilterWriter (Writer out)
�PushbackReader (Reader in)
PushbackReader (Reader in, int size)
�InputStreamReader (InputStream in)OutputStreamWriter (OutputStream out)
InputStreamReader (InputStream in, String enc)OutputStreamWriter(OutputStream out, String enc)
�FileReader(File file)throws FileNotFoundExceFileWriter(File file)
FileReader (String fileName) throws FileNotFoundExceFileWriter(String fileName)
throws FileNotFoundException �FileWriter(String fileName, boolean append)
throws IOException
FileReader (FileDescriptor fd)FileWriter(FileDescriptor fd)
�PipedReader ( )PipedWriter()
PipedReader (PipedWriter src)PipedWriter(PipedReader snk)
throws IOExceptionthrows IOException
�StringReader(String s)StringWriter()
StringWriter(int initialSize)
�PrintWriter(OutputStream out)
PrintWriter(OutputStream out, boolean autoFlush)
PrintWriter(Writer out)
PrintWriter(Writer out, boolean autoFlush)

1.abstract int read()
2.int read(byte[] buff)
3.int read(byte buff, int off, int len)
4.long skip(long n)
5.int available()
6.void mark (int readAheadLimit)
1.abstract void write(int byteVal)
2.void write(byte[] buff)
3.void write (byte[] buff, int off, int len)
4.void flush()
1.int read()
2.int read(char[] buff)
3.int read(char[] buff, int off, int len)
1.void write(int c)
2.void write(char[] c)
3.void write(char[] c, int off, int len)
4.void write(String str)
5.void write(String str, int off, int len)
TYPE readTYPE();
void readTYPE(TYPE );
PrintStreamdoes not throw any exception
void print(TYPE )
void println(TYPE )
boolean checkError()
void print(TYPE )
void println(TYPE )
boolean checkError()

Points about I/O Constructors
1.If Class is ArrayStream (ByteArrayInputStream, CharArrayReader):
�If it is i/p stream then one of constructors will take array of it�s name i.e byte[]/ char[] as argument.
�If it is o/p stream then no argument construction is there.
�For I/p stream Second constr. takes array and �int size� as other argument for buffering .
�For O/p Second constr. takes �int size� as arguments for buffering.
2.FilterInputStream constr�s take InputStream (i.e. any class from i/p classes) as arguments.
3.There are 4 derived classes from FilterInputStream :
2.LineNumberInputStream (Not available for O/p )
4.PushbackInputStream (NA for o/p)
Last two has two constr, other takes �int size� as second argument.(first is �InputStream in�) Holds true for o/p classes.
O/p class has one more class derived from FilterOutputStream
�PrintStream : It has one constr as �OutputStream out� and second constr takes second param as �boolean autoFlush�.
4.ObjectStream has TWO constr. First does not take any argument . Second takes
I/OStream(InputStream/ OutputStream) as argument.
5.PipedStream classes has two constr:
�First does not take any argument
�Second take PipedOtherStream, i.e PipedInputSteam(PipedOutputStream src) and PipedOutputStream(PipedInputStream )
6.FileI/OStreamClasses has 3 constrs, first take �File file� as param, Second take �String filePath�, Third take �FileDescriptor fbObj�.
For FileOutputStream there is one more constr, it takes TWO params, one is �String name�, and other is �boolean append �.
7.StringBuffer class has been deprecated.
8.SequenceI/OStream has two constr, First takes �Enumeration e� and other takes TWO params �InputStream s1, InputStream s2�

Reader/Writer Constructors
1.BufferedR/W has two constructors, First has one param as �Reader/Writer in/out�, SECOND has one more param as �int size� for buffer size.
2.LineNumberReader (No Writer) is derived from BufferedReader has TWO constr as BufferedReader has.
3.CharArrayReader has two consts one has char[] buf,(Writer does not has any param) and other has three param
char[] buf , int offset, int length (Writer has only one param int initialSize).
4.FilterReader has Reader in and FilterWriter has Writer out param for constr.
5.PushbackReader (NO Writer, is like PushbackInputStream) has two contrs. One has single param Reader in , and other has TWO param Reader in, int size.
6.InputStreamReader/Write has two constr. First take its stream(as name suggests) as param ie. InputStearm in. Second take two param InputStream in , String enc.
7.PipedReader/Writer has two constr. First with NO param and second with opposite pipedStream ie. PipedReader(PipedWriter src) and PipedWriter(PipedReader snk).
8.StringReader has one constr with String s as param. StringWriter has two constr. one with NO param, other has StringWriter(int initialSize).
9.Writer has one more class PrintWriter. It has four constr, in two groups, One group has OutputStream out, other has Writer out as param. One constr takes single param out, and other has one more param boolean autoFlush.
10.FileReader/Writer is same as FileI/OStream.
I do not know how much it will be helpful u too...
AW All the best ..
[ March 13, 2002: Message edited by: Ravish Kumar ]
SaiPrasad Jukalkar
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks alot ravish, your IO notes is excellent.
keep it up
qunlbao leon
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!