add java solution for query_board