Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

When to use Abstract Classes/Methods and Interface in Java?

Title say it all. Kindly if possible let me know the real world example of those two functions.

1 Answer

Start going through 'Java Web Development' Track. Starting from Spark and especially Spring you will see a ton of interface : needles to say. Finish these courses first.

About abstract classes, again... You are Java techdegree student, so I can tell you write away in Project number 7:

https://teamtreehouse.com/projects/instateam-with-spring-and-hibernate

There is a task for exceeds :

Extract the common code of each DAO implementation to an abstract class that the DAO implementations extend

As you can see this is real life example where you have to implement Abstract class. So keep on learning, you will get there...