I am with some exercise of basic java and i wender is my program is well written

I recommend that you watch the amazing YouTube videos on coding paradigms and practices by the Youtubers Fireship, Coderized, and CodeAesthetic.

Click on those names. I linked some of their videos to give you some guidance. Do not be intimidated by the potentially “out of your league” subjects covered. Watch the videos. They will give you a great head start, and point you in the right directions. These three channels are my all time favorites. Fireship give expert and straight to the point tips. CodeAesthetic gives expert step by step beautiful demonstrations. And Coderized gives expert and paced explanations with visuals similar to those of CodeAesthetic. You will love them.

One extremely helpful video from the YouTube channel Low level Learning, about how NASA produces error free code.