The president admitted that medical experts would discourage him from making such remarks.

As the number of COVID-19 cases in the U.S. surpassed 1.1 million over the weekend, President Donald Trump revealed that a vaccine for coronavirus could be available as soon as “the end of the year.”
“I think we’re going to have a vaccine much sooner rather than later,” he said during a virtual Fox News town hall on Sunday evening.
Trump conceded, however, that medical experts would likely dissuade him from making such claims.
“The doctors would say, ‘Well, you shouldn’t say that.’ I’ll say what I think,” Trump said.
Medical professionals including Dr. Anthony Fauci, the country’s leading expert on infectious diseases have said that it could take at least a year to 18 months for a vaccine to be developed. Even that timeline would be considered breakneck speed. 
Last week, Fauci told the “Today” show that he thought it was “in the realm of possibility” that a vaccine could be ready by January 2021. Fauci’s remarks followed news that the Trump administration had launched a project to spur the vaccine development process dubbed “Operation Warp Speed.” The initiative’s goal is to have 300 million doses of a vaccine available by January, Bloomberg reported.  
The Trump administration isn’t the only player keen to have a vaccine ready. Governments the world over have made vaccine development a priority, and pharmaceutical companies and research labs are racing against the clock in an effort to fulfill this need.  
A COVID-19 vaccine will need to be developed before the world can return to some semblance of pre-pandemic normalcy, medical experts say. Concerns, however, have been raised about whether efficacy and safety will be compromised in the desperate rush to hit this target.
“A vaccine has never gone like it’s gone now,” Trump claimed during Sunday’s town hall. “We’re so far ahead of any vaccine, ever, in history. These things would take two, four, five, six years, 10 years.”
The mumps vaccine is considered the fastest vaccine ever to be approved. That vaccine took four years to develop.
Still, Trump insisted that a COVID-19 vaccine would be ready in record time.
“I think we’re going to have a vaccine, I’m telling you, by the end of the year … I think we’re going to have a vaccine,” he said.