• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why compiles??  RSS feed

 
Murat Balkan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
There is something I did not understand in the code below:
out.write(ch);
It is compiling fine. But where is out defined???
Thnks
Murat
import java.io.*;
class DecryptedOutputStream extends FilterOutputStream
{

public DecryptedOutputStream(OutputStream out) {
super(out);

}

public void write(int ch) throws IOException {

if ((ch < 127) && (ch > 32)) {
ch = (ch - 10);
if (ch < 33) {
ch = 128 - (33 - ch);
}
}
out.write(ch);


}

} // end DecrypterOutputStream
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is member variable fo java.io.FilterOutputStream which is extended by your class and is defined as
protected java.io.OutputStream out;
cheers
Praful
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!