Pair-programming is a method in which two programmers are paired together and to develop software on a single PC. Pair-programming is one of the methods of software development, and it can be used to educate programmers since it has the aspect of promoting knowledge sharing between pairs. Therefore, we tried to incorporate pair-programming into the programming class. This paper introduces an example of pair-programming as a method for effective learning for beginners in programming. To verify the effectiveness, a questionnaire survey was conducted.