Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object to int array conversion

 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I just write a int[] in the ObjectOutputStream (In Applet) and I have to receive the same in other end(Servlet) using below code




I tried something but this is wrong. Please advive how to recive the same int [] here



Since this is a General Java query am posting this here
 
Henry Wong
author
Marshal
Pie
Posts: 21000
76
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try casting it?

Henry
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How ? From Object to int []
 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any array is an object, so yes, casting to int[] is allowed using (int[]).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic