Comments In Java | Java Tutorial

In Java, we have two types of comments. We use comments to write some text within our code. The compiler will ignore these comments.


Note: Comments in between the code gives more readability

Do you want to show auto-generated code whenever you create a new class as shown below?

Follow the below steps:

I assume you are using Eclipse IDE.

1. In eclipse, Go to Window – Preferences
2. From the left panel, Select Java – Code style – Code template
3. Under ‘Configure generated code and comments’, Expand Comments – Select Files and Click Edit and Enter your text and click OK.

Whenever you create a new class, you can see comments.

Sample Program:

Must Read: Java Tutorial

Sharing is caring.

Share on facebook
Share on twitter
Share on linkedin

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.


Leave a Comment

API Testing eBook