CSE 241 Frequently Asked Questions (FAQs)


Lab 2 Related Questions:

In BucketMapping.java, there is the line:
static final MappingRecord DELETED = new MappingRecord("");     // sentinel for deleted
What is a MappingRecord and where is it defined?

This is the class whose instances hold the key and associated data (the bucket). The key will be a String, and for the bucket you can use Java's ArrayList or LinkedList. In class, this was refered to as a MappingEntry. Feel free to pick whatever name you prefer. You should define this as an innerclass.


Lab 1 Related Questions:

When using Eclipse 3.1 on cec, Plotter.java gives a syntax error on line 19 where it reads "@SuppressWarnings("deprecation")". Is there something I can do to make this work on the version of Eclipse the cec computer lab has?

You can just remove the "@SupressWarnings" line. It was added for Java 5.0 and is not needed for older versions of Java. Another option is to reconfigure Eclipse to use Java 5.0 (as described in the next FAQ).

How can I configure Eclipse 3.1 to use Java 5.0?
First select the project, and then go to the "Project" pull-down tab. Then in the Projects menu select "Properties". Then select "Java Compiler" along the left-hand side of the project window. Then pick "Configure Workspace" from the top right. Then choose 5.0 from the "Compiler compliance level" dropdown menu. Click "OK".

Next, from the project properties dialog, choose "Java Build Path". Select "Libraries" at the top, and then select "Add Library" on the right. Then click "Alternate JRE". If Java 5.0 is in the pull-down menu select it. Otherwise, select "Installed JREs..." and select Java 5.0. Then pick "Finish". Then select the old library from the library list and pick "Remove", and click "OK". Then you will probably need to rebuild everything (or restart Eclipse).


Return to the CSE 241 Home Page