When it comes to giving advice about manhood, former US president Barack Obama is still the man.

Key points: Mr Obama said confident men don't need to surround themselves with "twerking" women

Mr Obama said confident men don't need to surround themselves with "twerking" women He advised boys to be compassionate, look for a mentor and find ways to help guide others

He advised boys to be compassionate, look for a mentor and find ways to help guide others The My Brother's Keeper initiative was launched after the 2012 shooting death of African-American teen Trayvon Martin

Appearing onstage this week with NBA Golden State Warriors superstar Stephen Curry, Mr Obama cracked up an audience of mainly young boys when responding to a question about being a man.

He said it meant being a good person, someone who is responsible, reliable, hard-working and compassionate — and not about life as portrayed in a hip-hop music video.

"If you are very confident about your sexuality, you don't have to have eight women around you twerking," he said to applause, with a video of his full response going viral in recent days.

Mr Obama, who left office in 2017, was in Oakland, California, to mark the fifth anniversary of My Brother's Keeper (MBK), an initiative he launched after the 2012 shooting death of 17-year-old African-American Trayvon Martin.

About 100 boys attended the first national gathering of the MBK alliance, an initiative to close opportunity gaps for African-American, Latino and Native American children, sponsored by the Obama Foundation.

Mr Obama and basketball star Curry spoke together for about an hour, answering questions from the audience and joking around. They talked about lacking confidence or being aimless as teens.

Mr Obama praised single mothers, including his own. He advised the boys to look for a mentor, and to find opportunities to guide others.

Curry joined the former president in praising the value of teamwork.

"What we do on the court and the joy that comes out of that is second to none," he said, "because nothing great is done by yourself."

AP/ABC