How To Write Max Function In Java