Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Object array help

$
0
0
Hi,

I created a Item class.It contains constructor,getmethods.Item class contains three attributes 1 String,1 Double and 1 Integer.That's ok.But then in my GUI i created a object array like this.

Item item[]=new Item[4];

then i want to hardcode the values.How to do that?I searched it on web and i did it as they have told.

item[0]=new Item("Shirt",20.00,1);

but it gives error.Why is that?Am i wrong?please help

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>