Messages - tsaint [ switch to compact view ]

Pages: prev1 ... 24 25 26 27 28 [29] 30 31 32 33 34 ... 97next
I'll have another go - have a look at to see if it's relevant to the discussion.

An interesting relic from the past - way back in Opera 5.x times, they had a thing called "Operashow", aimed at using html markup and css to do presentations with Opera.
It might have been relevant to you, apart from the Opera lockin, but I think the idea was subsequently abandoned. Shame.
 Maybe someone with the knowhow could write a quasi html editor, which uses stylesheets, dhtml etc to produce slides for a browser.

Java / Re: Beginner's dumb question ...
« on: April 23, 2010, 08:15 AM »
Sorry, 1 more question...
public int compareTo(Product other) works well if Ive created 2 objects, say wrench and sprocket ... I just use someinteger = wrench.compareTo(sprocket)
BUT.. what if I asked the user to input the names of 2 products into strings item1 and item2 for example. (so item1 = "wrench" and item2 = "sprocket")

Now someinteger = item1.compareTo(item2) won't work because item1 is a string, not an object, as is item2. So I need to get java to actually use the object whose name is the string in item1 and same for the item2
Can be done?

Java / Re: Beginner's dumb question ...
« on: April 22, 2010, 05:17 PM »
Hope that helps? Yes, a lot thanks, and thanks for taking the time.
I think my understanding is tenuous, at best, but I know enough to follow what you say needs to be done

Java / Beginner's dumb question ...
« on: April 22, 2010, 08:30 AM »
I have defined a class called Products (attached file)
The class has a method getNumInStock() to return the numbers in stock for any Product object I've created
I have made 2 objects called sprocket and wrench and can set the numbers of each in stock using a driver program.

My problem:
Add a method to the Product class called compareTo which takes a parameter specifying
another product- and returns an integer satisfying the following conditions:
0     if this product has the same number of items in stock as the other product
< 0   if this product has fewer items in stock than the other product
> 0   if this course has more items in stock than the other product

Fine, except from inside this new method, I can't retrieve the numbers in stock of objects. My effort at doing so is in line 41 of the attached file.
If any knowledgeable person is masochistic enough, or altruistic enough to explain how to do this, I would be really greatful.

Pages: prev1 ... 24 25 26 27 28 [29] 30 31 32 33 34 ... 97next
Go to full version