Implement javascript and Java class