Automatic code comment generation is an important research topic in software engineering, which aims to help developers understand the source code. However, this task is challenging due to the issues of long dependencies, source code structure information, and out-of-vocabulary (OOV) words. In this paper, we propose HCCM, a novel neural network model that uses three encoders to generate natural language comments for Java methods. The proposed model incorporates three novel techniques: (1) the S-SBT method to encode the abstract syntax tree of the source code; (2) a pointer generation network to copy OOV words from the source code; and (3) a convolutional neural network to capture local features of the source code tokens. We evaluate our model on a state-of-the-art large-scale Java dataset and show that it outperforms the existing methods on several metrics such as BLEU, METEOR, and ROUGE.