java problems/design