Software plagiarism checkers can be important during coding competitions, to review, evaluate, and rank the participants. For a problem statement, if the number of submissions is relatively small then inspecting each code submission and being able to determine whether they are similar to the existing code segment or not is easy, but in the case of huge code submissions, it is very difficult to determine the presence of code clones in the submitted code snippet. Therefore, there is a need for plagiarism checkers to detect similar clones. In existing studies, we could use various approaches to detect code clones, but code clone detection using an abstract syntax tree is one of the popular approaches. Our proposed approach based on AST is experimented on a BigCloneBench dataset consisting of Java code fragments and implemented using recursive neural networks. The siamese networks were used to detect similarities between two code fragments and presented the influence of contrastive learning in source code clone detection with high accuracy. This paper showcasesthe improvement in precision, recall and F1-score at least with 5% compared to existing approaches.