Police investigating the attack in Lochgelly on Saturday night said two males aged 16 and 19 were being held.
A 22-year-old man was injured outside the Premier Stores on Francis Street just before 22:00.
He was being treated at Victoria Hospital where his condition is said to be stable. The suspects are expected to appear in court on Tuesday.

Chris Oakley was criticised by Ofsted for keeping the animals at Luton Pentecostal Church Christian Academy.
The report - which rated the fee-paying the school as "inadequate" - said "no risk assessment" was made.
The BBC has contacted the school for a comment.
The Ofsted report said: "The proprietor has not ensured that all necessary risk assessments are carried out and that they are updated regularly.
"For example, a seven-foot-long boa constrictor and a number of tarantulas are kept in the principal's office.
"No risk assessment has been made to ensure that keeping such animals in school does not pose a risk to children."
The report said the school also kept a number of other pets - to "enhance the work of the school" - which had not been assessed for their risk to children.
The independent school has 58 pupils aged three to 13 years old.
It had been previously rated as "good" but government inspectors on their latest visit found it to be "inadequate" in all areas.
In addition to the safeguarding issues relating to the snake and spiders, Ofsted said the school had not met the "independent school standards".
It said the school had no first-aid policy, leaders "did not promote harmony" and that pupils' attainment is "below expectations for their age".
Ofsted did say, however, that pupils were "polite, friendly and well-mannered" and that behaviour was "good throughout the school".
It said leaders were "deeply committed" to further improvements.
Advice issued to schools by Public Health England says reptiles "are not suitable" as pets and that "all species carry salmonella".

Shueb Salar is alleged to have posted abusive language about women and homosexuals on Twitter, in 2012.
An investigation will be carried out into the "serious issues", said a spokesman for Labour candidate Mr Khan, an ex-shadow minister.
Mr Salar, who has not commented, started working for Mr Khan in 2014.
In light of the posts, cabinet minister Chris Grayling questioned Mr Khan's judgement in employing Mr Salar.
"'These comments have absolutely no place in modern society," the leader of the House of Commons said.
"The mayor of London makes a large number of decisions about who to hire and how to spend public funds: his record shows Sadiq Khan can't make those decisions in a way that stands up for Londoners."
Mr Khan is tipped by the bookies to become London's next mayor on 5 May, beating his Tory rival Zac Goldsmith.
A spokesman said: "Clearly these are serious issues. Shueb Salar has been suspended from Sadiq Khan's parliamentary office pending an investigation."
Two teenagers have been arrested in connection with an attempted murder outside a shop in Fife.
[NEXT_CONCEPT]
A head teacher kept a seven-foot (2.1m) boa constrictor and tarantulas in his school office without checking if they posed a risk to children, government inspectors found.
[NEXT_CONCEPT]
One of London mayoral hopeful Sadiq Khan's aides has been suspended after offensive social media messages were published.