Yes, it's possible to do. Consider the code below:
public class Test
{
public static void main (String[] args)
{
int v = 0;
if ((v=dostuff())!=0)
{
System.out.printf("HOWDY\n");
}
}
public static int dostuff()
{
//dosomething
return 1;
}
}
I hope this will satisfy your question.