Download presentation
Presentation is loading. Please wait.
1
Recitation 2 September 2, 2011 Ben Newton
2
As you come in… Please sit next to someone you would like to collaborate with during this recitation.
3
Today’s Goals: Install and Familiarize yourself with ObjectEditor
Discussed on Wednesday. Version 17. Later use version 18. Get more comfortable using the debugger. Catch any problems with making projects in Eclipse.
4
Notes: Please pay attention during instruction portion of the Recitation (hopefully only about 15 minutes) No surfing, No texting, No typing! Then you are free to work on the problem for the rest of the recitation time. You must work in pairs for today’s recitation.
5
Helpful Hints Read the assignment if you get stuck.
Lots of helpful hints there. Be sure to use the correct names! Package = main Class containing main method = Assignment# (where # is the assignment number, EXCEPT for first assignment) Submission zip file filename = YourFullName.zip Check out the Grading Rubrics Be careful submitting. (Resubmissions are difficult) See “How to submit your assignments”
6
Debugging Example Example on using the debugger
7
Setting up Object Editor
Copy and paste into project Jar must be on build path Import statement necessary! import bus.uigen.ObjectEditor; Must call ObjectEditor.edit(yourObject);
8
Using Object Editor
9
In-class Object Editor example
package main; //Calculate the square of an integer public class ASquareCalculator { public int square(int x) { return x*x; } } package main; import bus.uigen.ObjectEditor; //Object Editor Library //Use Object Editor to "edit" an instance of ASquareCalculator public class SquareCalculatorTester { public static void main(String[] args) { ASquareCalculator squareCalculator = new ASquareCalculator(); ObjectEditor.edit(squareCalculator); } }
10
Class Specification: Recitation 2
Package = main Write a class called FactorialPrinter with one method: main instantiates the FactorialPrinter class calls ObjectEditor.edit() on your object And a class called AFactorialCalculator with one method: factorial Has one argument which is an int Returns an int which is the factorial of the input When finished show a TA, and get checked off.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.