Re: Quick HashMap Question



xor wrote:
I'm doing up a school project using java, and am a little new to it (I've worked with other languages for years though).

I've seen code posted by the instructor using HashMap like this...

public HashMap<Position, Integer> boardNumbers;

... and ...

HashMap<Integer, Integer> allNumbers = new HashMap<Integer, Integer>();


... when I go to compile this (on my windows box) it craps out and complains...



Board.java:22: <identifier> expected public HashMap<Position, Integer> boardNumbers;

... and ...

Board.java:55: not a statement
HashMap<Integer, Integer> allNumbers = new HashMap<Integer, Integer>();


... both have carrots pointing at the opening <

is this a version issue or something? The school uses a unix environment, but I thought that shouldn't matter.
Any help would be appreciated.


thanks, dave


You have to be running JDK\JRE 1.5. This format is new in 1.5. You must be running an earlier version say 1.4

Uninstall your current Java version from the Add\remove program in the control panel.

Then download and install latest version jdk1.5.0_06
from  http://www.java.com/en/download/index.jsp

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________


'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)
.



Relevant Pages

  • Ada & C++
    ... I've got a simple question about using Ada together with C++ and other languages. ... If I have a library written in Ada and compiled eg. under Windows and then I want to compile it under Linux, I suppose there won't be any problems with that. ...
    (comp.lang.ada)
  • Re: Is CMUCL insane? P.S. Me vs. CLM (Common Lisp Music)
    ... Or to build Windows without a working version of Windows. ... why are you trying to compile CMUCL?" ... let's assume I use Linux and not an emulator here... ...
    (comp.lang.lisp)
  • Re: Term Rewriting vs. Functional Programming
    ... > general-purpose programs in FPLs than in TRSs. ... > in imperative languages, millions in functional languages and hundreds of ... >> optimise TRSs than FPs? ... > compile OCaml source that run at roughly the same speed. ...
    (comp.lang.functional)
  • Re: ANNOUNCE: DBI 1.54 RC6 - including cool new DBD::Gofer stateless proxy
    ... Fixed to compile for perl built with -DNO_MATHOMS thanks to Jerry D. ... Changed setting trace file to no longer write "Trace file set" to new file. ... Updated DBI::DBD docs for driver authors thanks to Ammon Riley ... Some testing on strange platforms, like Windows, would be helpful as ...
    (perl.dbi.users)
  • Re: Momentary black screen when program launches
    ... lets say the compiler takes 5 seconds to compile my source. ... seconds is up then I can get back to the Windows desktop and I will see an ... spawned by another program (IDE, Explorer, etc.) ... The Help and Support newsgroup is *terribly* named, ...
    (microsoft.public.windowsxp.general)