I\'m writing some code that basically follows the following format:
public static boolean isIncluded(E element) {
Node c = head;
while (c !=
Yes, usually (and in your case) it does break out of the loop and returns from the method.
One exception is that if there is a finally block inside the loop and surrounding the return statement then the code in the finally block will be executed before the method returns. The finally block might not terminate - for example it could contain another loop or call a method that never returns. In this case you wouldn't ever exit the loop or the method.
while (true)
{
try
{
return; // This return technically speaking doesn't exit the loop.
}
finally
{
while (true) {} // Instead it gets stuck here.
}
}