Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Machinegun Kelly

Pages: [1]
1
Java / Am I getting the concept down?
« on: December 05, 2013, 10:30:47 pm »
I am studying a Java programming book. There is a question in the book, and I wrote my answer down.


I ask, here on this board, what do y'all think of my answer?


What are the fundamental things you need to think about when you design a Java class?
 
When designing a Java class, it is important to prepare for possible spec changes (Plan for future problems, or possible occurrences).  Such as, if you have several objects w/ specific functions you should make a superclass if they all have the same method.
Your objects (the other classes) are the sub classes in your design that inherit their method from the superclass. Of course, there is the option of overriding the superclass from your sub class.
Using objective oriented programming when you have several classes is very nice, for when you have to edit code. All you have to do is add another object for example, rather than having to go through code and basically re-write it.

Pages: [1]