Solved linear search in java

Signed-off-by: Ionut Radu <ihonius@gmail.com>