• Post Reply Bookmark Topic Watch Topic
  • New Topic

questions on Colorable Interface  RSS feed

 
Debbie Thornton
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi!
I had a hopefully easy question.  In doing a Colorable Interface in Java Netbeans, do I need to add my square, circle, rectangle and geometric object codes all together?  If doing so, will this help me work out my Colorable Interface? (I hope I made sense, I am a NEWBIE, sorry) 

THANK YOU!!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Debbie.

What exactly do you mean with "do I need to add my square, circle, rectangle and geometric object codes all together"? What do you mean with "adding together" codes?
 
Campbell Ritchie
Marshal
Posts: 56545
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again

I think you can answer your question yourself. Answer these points, and I hope it will become clear. I don't think you will need any post‑Java8 features.
  • 1: What would it mean for something to be colourable?
  • 2: How many different things would something colourable do?
  • 3: If you have lots of things which are otherwise different, but are all described as colourable, what behaviour would they all share?
  • 4: Would you only need one sort of behaviour which all those different things share in order for them to be described as colourable? Or many different kinds of behaviour?
  • 5: How many methods are you going to need in your colourable interface?
  • 6: What are you going to write as a description of what colourable means? Remember that the documentation comments constitute a large majority of what is written in pre‑Java8 interfaces. Sometimes over 90% of what is written.
  • You might do well to create a Shape interface and make things like square and circle implement that.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!