Prime Minister Justin Trudeau told hundreds of attendees at a conference in Toronto on Monday that Canada's thriving technology sector is a result of the country's openness to immigrants and he hopes Canadians will continue to view immigration positively.

Trudeau was the first keynote speaker at the four-day conference, called Collision, which is being held in Canada for the first time.

Organizers are calling the event North America's fastest growing technology conference, and this is the first time it is being held outside the United States.

While being interviewed by Shahrzad Rafati, founder and CEO of Canadian entertainment company BroadbandTV Corporation, Trudeau stressed that Canada has become a major source of talent for tech all over the world and that it is attracting entrepreneurs to the country.

He also cited the federal government's investments in education and research as reasons for success in Canadian companies and startups.

"Access to talent obviously comes from immigration and it comes from training young and educating Canadians right," said Trudeau.

He said while many countries including the U.S. "are closing themselves off more to immigration," Canada is staying open.

"As we see anxieties and worries around the world, Canadians know that we get more resilient communities, we get better solutions, we get better innovations, when we bring in people from all around the world," Trudeau said.

"That's why we are doing well even at a time of anxiety — we have seen the Canadian economy flourish over the past few years."

Rafati also asked the prime minister about his recent announcement regarding the creation of a digital charter that would combat hate speech, misinformation and election interference.

Last week at the VivaTech conference in Paris, Trudeau said he's confident the framework his government will propose will restore the faith of citizens while holding online platforms accountable.

Rafati asked the prime minister to go into further detail about the proposal, but Trudeau only said it would focus on the government working collaboratively with tech companies to ensure citizen's personal information is safe and that solutions are made in regards to online harassment.

Innovation Minister Navdeep Bains is expected to provide more details at a summit on digital governance in Ottawa in late May.

"What you wouldn't allow in a personal space — in a real space — shouldn't be happening where people spend so much more time — in a virtual space," Trudeau said.

The Collision conference runs from Monday to Thursday at the Enercare Centre.