Umamageswari
Programmer
Hi,
I want to put a vector into a stream. For that I have created a StreamWriter and I am writing the vector. Below is the code and error message I get.
class StreamWriter
{
void handlestream(String[] str,Vector t)
{
Vector temp = new Vector();
for(int i=0;i<=t.size();i++)
{
temp.addElement(t.elementAt(i));
System.out.println(temp);
}
StreamWriter newstream = new StreamWriter();
newstream.write(temp);
}
}
pakstream\StreamWriter.java:22: cannot resolve symb
symbol : method write (java.lang.String)
location: class pakstream.StreamWriter
newstream.write("Hello"
^
1 error
Pls say the coding is correct or not and what is the error. Pls help me in this regard.
thanks.
Uma
I want to put a vector into a stream. For that I have created a StreamWriter and I am writing the vector. Below is the code and error message I get.
class StreamWriter
{
void handlestream(String[] str,Vector t)
{
Vector temp = new Vector();
for(int i=0;i<=t.size();i++)
{
temp.addElement(t.elementAt(i));
System.out.println(temp);
}
StreamWriter newstream = new StreamWriter();
newstream.write(temp);
}
}
pakstream\StreamWriter.java:22: cannot resolve symb
symbol : method write (java.lang.String)
location: class pakstream.StreamWriter
newstream.write("Hello"
^
1 error
Pls say the coding is correct or not and what is the error. Pls help me in this regard.
thanks.
Uma