Forty refers to forty years old. "At thirty, you will be able to stand on your own feet, and at forty, you will not be confused." It means: at thirty, you will be able to stand on your own; at forty, you will not be confused by external things.
From "The Analects of Confucius·Wei Zheng". The original text is: Confucius said: "When I was fifteen, I was determined to learn; when I was thirty, I was established; when I was forty, I was not confused; when I was fifty, I knew the destiny of heaven; when I was sixty, my ears were attuned; when I was seventy, I followed my heart's desires without exceeding the rules."
Translation: Confucius said: "I am determined to study at the age of fifteen; I am able to stand on my own feet at the age of thirty; I am not deceived by external things at the age of forty; I understand the destiny at the age of fifty; I can treat all kinds of opinions correctly at the age of sixty , don’t feel uncomfortable; at seventy, he can do whatever he wants without going beyond the rules.”
Extended information:
Commentary: In this chapter, Confucius describes his study and cultivation. process. This process is a process in which one’s ideological realm gradually improves with age. As far as the ideological realm is concerned, the whole process is divided into three stages: the age of fifteen to forty is the stage of learning and understanding; the age of fifty and sixty is the stage of peace of mind, that is, the stage of not being affected by the environment; the stage of seventy Age is the stage when subjective consciousness and rules of life merge into one. In this stage, moral cultivation reaches its highest level.
Confucius’s moral cultivation process has reasonable factors: first, he saw that human moral cultivation is not something that happens overnight. There must be a step-by-step process. Second, the highest state of morality is the integration of thoughts, words and deeds, and consciously abide by moral norms rather than doing it reluctantly. These two points apply to everyone.
Baidu Encyclopedia-The Analects of Confucius·Wei Zheng