Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > problem with statement

Reply
Thread Tools

problem with statement

 
 
Jeremy Watts
Guest
Posts: n/a
 
      06-10-2007
Hi,

I have the Java JDK installed on my old Sony Vaio laptop, but recently
switched to use my newer computer. I re-installed the Java development kit
(which used to be called the JDK ?? and now is called the SDK or
something.... Anyway I use the BlueJ IDE alongside it too, so also
downloaded that, so far so good.

I take a Java program from my old machine to try on my new set-up and theres
an error generated at a particular line, the error says :-

" '(' or '[' expected "

And the line in question is :-

"List<Object>result = new ArrayList<Object>();"

This works fine on my old set-up but not on the new!!??? Why?????????

Please save my mental health...

Jeremy Watts


 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      06-10-2007


Jeremy Watts wrote on 10.06.2007 13:26:
> Hi,
>
> I have the Java JDK installed on my old Sony Vaio laptop, but recently
> switched to use my newer computer. I re-installed the Java development kit
> (which used to be called the JDK ?? and now is called the SDK or
> something.... Anyway I use the BlueJ IDE alongside it too, so also
> downloaded that, so far so good.
>
> I take a Java program from my old machine to try on my new set-up and theres
> an error generated at a particular line, the error says :-
>
> " '(' or '[' expected "
>
> And the line in question is :-
>
> "List<Object>result = new ArrayList<Object>();"
>
> This works fine on my old set-up but not on the new!!??? Why?????????


Looks like on your old computer you had Java 1.5 installed and your new computer
has Java 1.4. You have to remove the (outdated) JDK from your new computer and
install a more recent version (Java6 aka 1.6 or Java5 aka 1.5)

Thomas
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      06-15-2007
On Sun, 10 Jun 2007 11:26:18 GMT, "Jeremy Watts"
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>I have the Java JDK installed on my old Sony Vaio laptop, but recently
>switched to use my newer computer. I re-installed the Java development kit
>(which used to be called the JDK ?? and now is called the SDK or
>something.... Anyway I use the BlueJ IDE alongside it too, so also
>downloaded that, so far so good.
>
>I take a Java program from my old machine to try on my new set-up and theres
>an error generated at a particular line, the error says :-
>
>" '(' or '[' expected "
>
>And the line in question is :-
>
>"List<Object>result = new ArrayList<Object>();"
>
>This works fine on my old set-up but not on the new!!??? Why?????????


I suspect you have installed a very old Java that does not understand
generics. See http://mindprod.com/jgloss/jdk.html
to get the latest JDK (Java Development Kit)
SDK is Microsoft's term.

follow the instructions for install and test.

Check out your installation with wassup
see http://mindprod.com/applet/wassup.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement that, when false, skips first statement in its block, executes second? Jay McGavren Java 11 01-16-2006 05:49 PM
How do I do a conditional statement in a constant statement? tkvhdl@gmail.com VHDL 3 12-16-2005 06:13 PM
Which of switch statement and if-else statement takes less time to execute? swaroophr@gmail.com C Programming 21 08-02-2005 09:24 AM
exec "statement" VS. exec "statement in globals(), locals() Ted Python 1 07-22-2004 08:51 AM
exec "statement" VS. exec "statement" in globals(), locals() tedsuzman Python 2 07-21-2004 08:41 PM



Advertisments