0

how to write more than one object to ObjectOutputStream in single response(Objects are not fixed,objects are creating dynamically as per user's request).can i use either Arraylist or Vector for this,please give some sample program.

TexxtViews text=new TexxtViews(2, -2, 2, "WELCOME TO CCS");//First Object
ButtonView button=new ButtonView(-2, 2, "OK");//Second Object
ArrayList array=new ArrayList();
array.add(text);
array.add(button);
   OutputStream out = resp.getOutputStream();
   ObjectOutputStream outSt = new ObjectOutputStream(out);
  outSt.writeObject(array);

tried this code

Rajesh M P
  • 477
  • 1
  • 10
  • 21

0 Answers0