• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

QUICK Java question!

I have to do a design for a program...

One of my instance variables is (since we are designing, we are being abstract)

private Set<Planet> planets;


Yet when I compile from the school computers, I got an error saying <indentifier> expected on that line. Yet it works fine from home. And I've done the same exact Set thing so many times... like my last assignment had private Set<Track> tracks; without error. WTF?? I imported java.util.* but that didn't help. Any ideas?
 
Nope, I'm only importing java.util.* which I may not even need.

Hell, the reason I'm doing that Set is because my prof has a lot of examples that way. A previous solution to our last design here shows the exact same syntax, yet mine gets an error...

The error happens in Universe.java, but I do have a Planet.java too so I don't see the problem with it.
 
Looks to me that you're likely using a 1.5+ version at school and a < 1.5 version at home. Generics weren't in Java until 1.5. Just make sure you have the same version or download a new JDK.
 
Originally posted by: Descartes
Looks to me that you're likely using a 1.5+ version at school and a < 1.5 version at home. Generics weren't in Java until 1.5. Just make sure you have the same version or download a new JDK.

But then their last project wouldn't have compiled as it also uses them. I almost posted that then I noticed.
 
Originally posted by: AFB
Originally posted by: Descartes
Looks to me that you're likely using a 1.5+ version at school and a < 1.5 version at home. Generics weren't in Java until 1.5. Just make sure you have the same version or download a new JDK.

But then their last project wouldn't have compiled as it also uses them. I almost posted that then I noticed.

Yeah. I guess I could have read the entire sentence 😀 It's been a long week.
 
Back
Top