"How to" or "How do you"
You can use "How to" as the title of a document. For example, "How to Lock a File in Java". But, if you want to ask a question, use: "How do you lock a file in Java?"
Re #15734: how to lock a file in Java? I mean how java provide flock()?