Top.Mail.Ru
April 11th, 2005 - Java developers — LiveJournal
? ?

Java developers

April 11th, 2005
 

12:33 am - ex_bluelili

I'm trying to understand our lab assignment for my Java class and I just would like someone to clarify something about this particular question for me. Please don't think I'm asking for an answer...


Write a class Compare3 that provides a static method largest. Method largest should take three Comparable parameters and return the largest of the three (so its return type will also be Comparable). Recall that method compareTo is part of the Comparable interface, so largest can use the compareTo method of its parameters to compare them.


In this assignment the "Comparable" paramaters are supposed to be of what type?? Does that even matter? Can someone explain this in a more laymans' terms type way for me?

Thanks ;)

02:17 pm - mireille719

I'm working on a project for a class, and what we're having to do is write a text editor. We're using Java, and that's non-negotiable at this point, as it's so late in the semester.

Most of the problems I've run into are things I've been able to read up on and fix, but there are three things that have me stumped, and I can't find any code examples that do anything similar.

1) My prof wants us to create an Edit menu that will have cut, copy, paste, and select all features. Now, the standard Windows keyboard shortcuts for cut-copy-paste (the application only has to run under Windows) work fine, but I don't know how to implement them as menu commands.

2) We're supposed to implement word wrap, so that the text doesn't flow off the visible window.

3) It has to print, and I don't know how to do that.

I'm not looking for "this is exactly what you do," more "here are some places you can look for help" (and more specific than "look at the Java API"), or "here are some examples of code that has done similar things; see how you can use similar ideas in your own code."

I'm the only person in my project group who can code at all, and programming is *not* my area of expertise, so I'd appreciate any help.
Powered by LiveJournal.com