Go to Post Tinted safety glasses and ice cream cones allowed in the pits? What else could go wrong!?! - logank013 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 30-10-2009, 22:45
isaacdl isaacdl is offline
I have a white hat..it's just dirty
AKA: Isaac Dontje Lindell
FRC #3018 (Nordic Storm)
 
Join Date: Oct 2009
Rookie Year: 2010
Location: St. Peter
Posts: 32
isaacdl is an unknown quantity at this point
Question regarding interfaces

Hi,

I'm trying to teach myself Java for this years competition, having never done anything more complex than Liberty Basic. I understand classes, and how to use one to define an object. I'm using the Java tutorials on Sun.com to teach myself. I got to the section on interfaces, and for the life of me I cannot understand how to use them, or even what they are.
I have this sample program (attached), which uses bicycles as an example class. There is the superclass Bicycle, and the subclass MountainBike. 3 objects are defined, bike1, bike2, and bike3. Bike1 and bike2 are normal Bicycle objects, and bike3 is a MountainBike.

Bicycle has states "cadence", "speed", and "gear". It has methods "changeCadence", "changeGear", "speedUp", "applyBrakes".

MountainBike extends class Bicycle to include state "awesomeness" (first state that popped to mind )

At the end, the program prints the states of each bike.

How would I use interfaces in a useful manner in this program? What use are they in general?

Thanks,
Isaac
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
question regarding driverstation ringo115 Programming 4 16-02-2009 11:16
Question Regarding Torque - Pulling CollmandosGrl Technical Discussion 2 31-01-2008 17:56
Simple question regarding OI LED's Tom Line Programming 3 29-01-2008 12:03
Question regarding to Battery Packaging sxlterps General Forum 1 19-02-2005 17:37
Question regarding Florida archiver 2001 1 24-06-2002 03:00


All times are GMT -5. The time now is 08:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi