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

Hi Every one, " What is the purpose using "do","while","if" and "switch:" loops in the java programming."

I have such a hard to define such one we use while programming in java. They almost have similar characteristics. Their any easy to use each one of them. Please respond me.

1 Answer

Steven Parker
Steven Parker
231,046 Points

As you've noticed, there's often more than one way to do something in programming. Loops (while/do) and conditionals (if/switch) can be implemented with different keywords and syntax. With practice, you will find that some methods work better in some programming situations. But to begin with, it's good just to learn which variations exist and how they are structured.