Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #2153
| Received | by 10.224.70.131 with SMTP id d3mr3681141qaj.0.1350094201125; Fri, 12 Oct 2012 19:10:01 -0700 (PDT) |
|---|---|
| Received | by 10.236.88.236 with SMTP id a72mr900516yhf.20.1350094201101; Fri, 12 Oct 2012 19:10:01 -0700 (PDT) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!l8no47207528qao.0!news-out.google.com!r17ni23815258qap.0!nntp.google.com!l8no47207526qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.help |
| Date | Fri, 12 Oct 2012 19:10:00 -0700 (PDT) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=206.209.101.161; posting-account=g5PvsgoAAACpLQpk_VHurmxB_q2jbnOV |
| NNTP-Posting-Host | 206.209.101.161 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <b643cfda-6dda-4d8d-aa1a-1ae01740291b@googlegroups.com> (permalink) |
| Subject | Need Help with some code. Not sure why it's not working. Can someone please take a look? |
| From | ortizgabriel79@gmail.com |
| Injection-Date | Sat, 13 Oct 2012 02:10:01 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.java.help:2153 |
Show key headers only | View raw
It keeps saying that type ArrayList is not generic and cannot be parametierized with arguments <Double>
AND that Parameterized types are only available if source type is 5.0
I'm using Eclipse to comiple everything.
public static void main(String args[]) {
DecimalFormat df = new DecimalFormat("###,###.00");
double[] PRICE_ARRAY = { 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98 };
double[] QUANTITY_ARRAY = { 4.0, 8.5, 6.0, 7.35, 9.0, 15.3, 3.0, 5.4, 2.9, 4.8 };
ArrayList<Double> priceList = new ArrayList<Double>();
ArrayList<Double> quantityList = new ArrayList<Double>();
ArrayList<Double> amountList = new ArrayList<Double>();
for (int i=0; i < 10; i++){
priceList.add(new Double(PRICE_ARRAY[i]));
quantityList.add(new Double(QUANTITY_ARRAY[i]));
}
result = "";
for (int i = 0; i < 10; i++) {
amountList.add((Double.valueOf(priceList.get(i).toString())) * (Double.valueOf(quantityList.get(i).toString())));
result += String.valueOf(i+1) + ") "
+ new String(df.format(priceList.get(i))) + " * "
+ new String(df.format(quantityList.get(i))) + " = "
+ new String(df.format(amountList.get(i))) + "\n";
Back to comp.lang.java.help | Previous | Next — Next in thread | Find similar | Unroll thread
Need Help with some code. Not sure why it's not working. Can someone please take a look? ortizgabriel79@gmail.com - 2012-10-12 19:10 -0700 Re: Need Help with some code. Not sure why it's not working. Can someone please take a look? Lew <lewbloch@gmail.com> - 2012-10-12 22:42 -0700 Re: Need Help with some code. Not sure why it's not working. Can someone please take a look? Eric Sosman <esosman@comcast-dot-net.invalid> - 2012-10-13 09:23 -0400 Re: Need Help with some code. Not sure why it's not working. Can someone please take a look? John Dildy <jdildy85@gmail.com> - 2012-12-02 13:56 -0800
csiph-web