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 Java Data Structures - Retired Exploring the Java Collection Framework Using ArrayLists

Else if

Why couldn’t Craig just use an else if statement instead of creating a private method at 4:00?

2 Answers

I don’t know, but you can see he addresses the DRY issue by creating a private method to check the first character of a word

Gonzalo Torres del Fierro
PLUS
Gonzalo Torres del Fierro
Courses Plus Student 16,751 Points

I think it is possible with the else if(statement), but maybe the reason it is to share "when and how", to create a private method ( we can see that is not so different than the public one) and at the same time showing not to get "DRY". But Craig has the last word on this.....