All the coding done in JAVA