Yes, a Java compiler performs some type inference. For example, in
  public static void main(String[] args)
  {
     int x = 1, y = 4;
     int z = 2*x + y;
     …
  }
the compiler determines that expression 2*x has type int, even though the program does not explicitly say that 2*x has type int.

In Java, type inference on expressions is strictly inside-out. The type of an expression depends only on the variables, constants and operations (or method calls) that occur in that expression. So it only depends on the types of the subexpressions.

Some language, such as Cinnameg, Haskell and SML, take type inference further and allow one expression to influence the type of another. There are good and bad things about that. With full type inference, you usually do not need to indicate the type of anything. But type errors can be more difficult to understand.