• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inheritance and interfaces

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My teacher told me practise hierarchy and inheritance to write a programme that increments,decrements and resets;
1.natural numbers
2.ascii numbers
3.dates
4.hexa decimal numbers


please guys help me before tomorow thanks!
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello and Welcome to the Ranch!

A couple of things to get you started off on the right foot in our community:

* ShowSomeEffort - show us what you've done so far

* TellTheDetails - give us as much information as you can about what you're trying to do and what's not going so well

* EaseUp - we're pretty easy going around here so we don't respond well to "URGENT!" requests
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome again.

What is an ASCII number?
 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ascii codes
the codes behind characters & keys on the keyboard
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I imagine my first step would be defining an interface that all four of those categories can implement.
Then implement that interface for numbers.


 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes
i did the first one but the rest failed
i request fo help
thank you!
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stefan Evans wrote:Well I imagine my first step would be defining an interface that all four of those categories can implement.
Then implement that interface for numbers.


@Kithama: And indeed the other three things you mentioned.

I also think it might be worth finding out what "reset" means for a date - or indeed, a 'natural' number.

Winston
 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reset -means that after incrementing & decrementing say for the dates after incrementing by 1 day for like 20times you can take it back to the original date that you started with


as for natural numbers i mean the counting numbers like 0123456789...
Thanks ;-)
 
Stefan Evans
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So as Junilu indicated above, you need to ShowSomeEffort and TellTheDetails

What have you got so far?
What code have you written?
What is not working about it?

Share what you've done and we can help you along the way.
 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Per now i hav writte one that
increments , decrements & resets the countin numbers.
It icrement from 0 till 50 then decrements from 50-0
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic