problems solved in JAVA