I am using this code to translate my word or sentence using Microsoft Translation API
public class TranslateMicrosoft { String subscriptionKey = "my k