I encountered a problem deleting my own post that contained answers on it. Is there any way I could make my posts with answers invisible to non stackoverflow members at least?
You may not delete questions which have upvoted answers. But, as the owner of that content, you may have your account disassociated from it. Flag the question for moderator attention and ask that the question be disassociated from your ID.
This is not just a feature of the site - it is a legal requirement of the Creative Commons license. You have a "moral right" to have your name removed from your work if you object to its use. The reasons for your objection are irrelevant, so even if you object on the grounds that it makes you look silly, you have legal rights to have the content disassociated from you. (*IANAL)
SO is not required to delete it, however. By posting it, you've agreed to license the content to Stack Overflow and that agreement is binding. The content will continue to exist on SO's servers.
By disassociating the post, you will lose all rep gained (or lost) and it will no longer appear in the list of questions on your profile - it will be as if another user had asked it in the first place.
For more information, see:
When you signed up as a user you agreed to license your contributions to Stack Exchange. The purpose of Stack Exchange is to share knowledge on the Internet, so you don't get to decide on your own that something should be removed.
That said, if an answer is actually bad -- e.g. contains wrong information and you can't update it -- then you can delete it. In that case its presence makes the Internet worse. You can also delete answers that turn out to be redundant; I've done that several times, finding that while I was typing somebody else was supplying a better one. Questions are harder; even if you don't like your question or are embarrassed that you made that mistake, if someone supplied an upvoted answer then you can't delete it without moderator intervention -- and making that case will be hard. Deletion cases need to be dealt with on an individual basis; you can't just wipe out everything.
You can, as noted by others, disassociate your posts so they aren't identified as yours. But you generally can't completely remove (or hide) them; that's not what Stack Exchange is about.