Did David have a choice? Could he have NOT sinned at that time? Remember—he was a man after God’s own heart.
Yes.
Could he have NOT sinned at that time? Rememberhe was a man after Gods own heart.
He had the ability to Not Sin. He chose to Sin.
God foreknew that David would sin, so there was certainly 0% statistical chance that David would not (God cannot be wrong in His foreknowledge, of course); but David did have the choice.