two Java problems