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.

Syntax:

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

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

Leave a Comment

Share via
Copy link
Powered by Social Snap